ent

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2021 License: Apache-2.0 Imports: 30 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.
	TypeAdministrator        = "Administrator"
	TypeDeletedVlanLog       = "DeletedVlanLog"
	TypeDevice               = "Device"
	TypeDevicePlatform       = "DevicePlatform"
	TypeDeviceType           = "DeviceType"
	TypeIPAddress            = "IPAddress"
	TypeIPStaticRoutingTable = "IPStaticRoutingTable"
	TypeNetInterface         = "NetInterface"
	TypeNetInterfaceLayer    = "NetInterfaceLayer"
	TypeNetInterfaceMode     = "NetInterfaceMode"
	TypeNetTopology          = "NetTopology"
	TypeNetTopologyDeviceMap = "NetTopologyDeviceMap"
	TypePortChannelInterface = "PortChannelInterface"
	TypeVlan                 = "Vlan"
)

Variables

This section is empty.

Functions

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks 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 Administrator

type Administrator struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Username holds the value of the "username" field.
	Username string `json:"username,omitempty"`
	// Password holds the value of the "password" field.
	Password string `json:"password,omitempty"`
	// contains filtered or unexported fields
}

Administrator is the model entity for the Administrator schema.

func (*Administrator) String

func (a *Administrator) String() string

String implements the fmt.Stringer.

func (*Administrator) Unwrap

func (a *Administrator) Unwrap() *Administrator

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

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

type AdministratorClient

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

AdministratorClient is a client for the Administrator schema.

func NewAdministratorClient

func NewAdministratorClient(c config) *AdministratorClient

NewAdministratorClient returns a client for the Administrator from the given config.

func (*AdministratorClient) Create

Create returns a create builder for Administrator.

func (*AdministratorClient) CreateBulk

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

func (*AdministratorClient) Delete

Delete returns a delete builder for Administrator.

func (*AdministratorClient) DeleteOne

DeleteOne returns a delete builder for the given entity.

func (*AdministratorClient) DeleteOneID

func (c *AdministratorClient) DeleteOneID(id int) *AdministratorDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*AdministratorClient) Get

Get returns a Administrator entity by its id.

func (*AdministratorClient) GetX

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

func (*AdministratorClient) Hooks

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

Hooks returns the client hooks.

func (*AdministratorClient) Query

Query returns a query builder for Administrator.

func (*AdministratorClient) Update

Update returns an update builder for Administrator.

func (*AdministratorClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*AdministratorClient) UpdateOneID

func (c *AdministratorClient) UpdateOneID(id int) *AdministratorUpdateOne

UpdateOneID returns an update builder for the given id.

func (*AdministratorClient) Use

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

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

type AdministratorCreate

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

AdministratorCreate is the builder for creating a Administrator entity.

func (*AdministratorCreate) Mutation

Mutation returns the AdministratorMutation object of the builder.

func (*AdministratorCreate) Save

Save creates the Administrator in the database.

func (*AdministratorCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*AdministratorCreate) SetPassword

func (ac *AdministratorCreate) SetPassword(s string) *AdministratorCreate

SetPassword sets the "password" field.

func (*AdministratorCreate) SetUsername

func (ac *AdministratorCreate) SetUsername(s string) *AdministratorCreate

SetUsername sets the "username" field.

type AdministratorCreateBulk

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

AdministratorCreateBulk is the builder for creating many Administrator entities in bulk.

func (*AdministratorCreateBulk) Save

Save creates the Administrator entities in the database.

func (*AdministratorCreateBulk) SaveX

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

type AdministratorDelete

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

AdministratorDelete is the builder for deleting a Administrator entity.

func (*AdministratorDelete) Exec

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

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

func (*AdministratorDelete) ExecX

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

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

func (*AdministratorDelete) Where

Where adds a new predicate to the AdministratorDelete builder.

type AdministratorDeleteOne

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

AdministratorDeleteOne is the builder for deleting a single Administrator entity.

func (*AdministratorDeleteOne) Exec

Exec executes the deletion query.

func (*AdministratorDeleteOne) ExecX

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

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

type AdministratorGroupBy

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

AdministratorGroupBy is the group-by builder for Administrator entities.

func (*AdministratorGroupBy) Aggregate

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

func (*AdministratorGroupBy) Bool

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

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

func (*AdministratorGroupBy) BoolX

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

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

func (*AdministratorGroupBy) Bools

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

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

func (*AdministratorGroupBy) BoolsX

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

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

func (*AdministratorGroupBy) Float64

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

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

func (*AdministratorGroupBy) Float64X

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

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

func (*AdministratorGroupBy) Float64s

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

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

func (*AdministratorGroupBy) Float64sX

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

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

func (*AdministratorGroupBy) Int

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

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

func (*AdministratorGroupBy) IntX

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

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

func (*AdministratorGroupBy) Ints

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

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

func (*AdministratorGroupBy) IntsX

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

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

func (*AdministratorGroupBy) Scan

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

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

func (*AdministratorGroupBy) ScanX

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

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

func (*AdministratorGroupBy) String

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

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

func (*AdministratorGroupBy) StringX

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

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

func (*AdministratorGroupBy) Strings

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

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

func (*AdministratorGroupBy) StringsX

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

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

type AdministratorMutation

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

AdministratorMutation represents an operation that mutates the Administrator nodes in the graph.

func (*AdministratorMutation) AddField

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

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

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

func (*AdministratorMutation) AddedField

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

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

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

func (*AdministratorMutation) AddedIDs

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

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

func (*AdministratorMutation) ClearEdge

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

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

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

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

func (*AdministratorMutation) ClearedFields

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

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

func (AdministratorMutation) Client

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

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

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

func (*AdministratorMutation) Field

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

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

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

func (*AdministratorMutation) Fields

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

func (m *AdministratorMutation) 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.

func (*AdministratorMutation) OldField

func (m *AdministratorMutation) 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 (*AdministratorMutation) OldPassword

func (m *AdministratorMutation) OldPassword(ctx context.Context) (v string, err error)

OldPassword returns the old "password" field's value of the Administrator entity. If the Administrator 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 (*AdministratorMutation) OldUsername

func (m *AdministratorMutation) OldUsername(ctx context.Context) (v string, err error)

OldUsername returns the old "username" field's value of the Administrator entity. If the Administrator 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 (*AdministratorMutation) Op

func (m *AdministratorMutation) Op() Op

Op returns the operation name.

func (*AdministratorMutation) Password

func (m *AdministratorMutation) Password() (r string, exists bool)

Password returns the value of the "password" field in the mutation.

func (*AdministratorMutation) RemovedEdges

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

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

func (*AdministratorMutation) RemovedIDs

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

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

func (m *AdministratorMutation) 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 (*AdministratorMutation) ResetPassword

func (m *AdministratorMutation) ResetPassword()

ResetPassword resets all changes to the "password" field.

func (*AdministratorMutation) ResetUsername

func (m *AdministratorMutation) ResetUsername()

ResetUsername resets all changes to the "username" field.

func (*AdministratorMutation) SetField

func (m *AdministratorMutation) 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 (*AdministratorMutation) SetPassword

func (m *AdministratorMutation) SetPassword(s string)

SetPassword sets the "password" field.

func (*AdministratorMutation) SetUsername

func (m *AdministratorMutation) SetUsername(s string)

SetUsername sets the "username" field.

func (AdministratorMutation) Tx

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

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

func (*AdministratorMutation) Type

func (m *AdministratorMutation) Type() string

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

func (*AdministratorMutation) Username

func (m *AdministratorMutation) Username() (r string, exists bool)

Username returns the value of the "username" field in the mutation.

type AdministratorQuery

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

AdministratorQuery is the builder for querying Administrator entities.

func (*AdministratorQuery) All

All executes the query and returns a list of Administrators.

func (*AdministratorQuery) AllX

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

func (*AdministratorQuery) Clone

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

func (*AdministratorQuery) Count

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

Count returns the count of the given query.

func (*AdministratorQuery) CountX

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

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

func (*AdministratorQuery) Exist

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

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

func (*AdministratorQuery) ExistX

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

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

func (*AdministratorQuery) First

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

func (*AdministratorQuery) FirstID

func (aq *AdministratorQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*AdministratorQuery) FirstIDX

func (aq *AdministratorQuery) FirstIDX(ctx context.Context) int

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

func (*AdministratorQuery) FirstX

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

func (*AdministratorQuery) GroupBy

func (aq *AdministratorQuery) GroupBy(field string, fields ...string) *AdministratorGroupBy

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

Example:

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

client.Administrator.Query().
	GroupBy(administrator.FieldUsername).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*AdministratorQuery) IDs

func (aq *AdministratorQuery) IDs(ctx context.Context) ([]int, error)

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

func (*AdministratorQuery) IDsX

func (aq *AdministratorQuery) IDsX(ctx context.Context) []int

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

func (*AdministratorQuery) Limit

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

Limit adds a limit step to the query.

func (*AdministratorQuery) Offset

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

Offset adds an offset step to the query.

func (*AdministratorQuery) Only

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

func (*AdministratorQuery) OnlyID

func (aq *AdministratorQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*AdministratorQuery) OnlyIDX

func (aq *AdministratorQuery) OnlyIDX(ctx context.Context) int

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

func (*AdministratorQuery) OnlyX

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

func (*AdministratorQuery) Order

Order adds an order step to the query.

func (*AdministratorQuery) Select

func (aq *AdministratorQuery) Select(field string, fields ...string) *AdministratorSelect

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

Example:

var v []struct {
	Username string `json:"username,omitempty"`
}

client.Administrator.Query().
	Select(administrator.FieldUsername).
	Scan(ctx, &v)

func (*AdministratorQuery) Unique

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

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

Where adds a new predicate for the AdministratorQuery builder.

type AdministratorSelect

type AdministratorSelect struct {
	*AdministratorQuery
	// contains filtered or unexported fields
}

AdministratorSelect is the builder for selecting fields of Administrator entities.

func (*AdministratorSelect) Bool

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

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

func (*AdministratorSelect) BoolX

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

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

func (*AdministratorSelect) Bools

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

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

func (*AdministratorSelect) BoolsX

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

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

func (*AdministratorSelect) Float64

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

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

func (*AdministratorSelect) Float64X

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

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

func (*AdministratorSelect) Float64s

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

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

func (*AdministratorSelect) Float64sX

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

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

func (*AdministratorSelect) Int

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

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

func (*AdministratorSelect) IntX

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

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

func (*AdministratorSelect) Ints

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

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

func (*AdministratorSelect) IntsX

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

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

func (*AdministratorSelect) Scan

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

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

func (*AdministratorSelect) ScanX

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

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

func (*AdministratorSelect) String

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

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

func (*AdministratorSelect) StringX

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

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

func (*AdministratorSelect) Strings

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

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

func (*AdministratorSelect) StringsX

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

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

type AdministratorUpdate

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

AdministratorUpdate is the builder for updating Administrator entities.

func (*AdministratorUpdate) Exec

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

Exec executes the query.

func (*AdministratorUpdate) ExecX

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

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

func (*AdministratorUpdate) Mutation

Mutation returns the AdministratorMutation object of the builder.

func (*AdministratorUpdate) Save

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

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

func (*AdministratorUpdate) SaveX

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

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

func (*AdministratorUpdate) SetPassword

func (au *AdministratorUpdate) SetPassword(s string) *AdministratorUpdate

SetPassword sets the "password" field.

func (*AdministratorUpdate) SetUsername

func (au *AdministratorUpdate) SetUsername(s string) *AdministratorUpdate

SetUsername sets the "username" field.

func (*AdministratorUpdate) Where

Where adds a new predicate for the AdministratorUpdate builder.

type AdministratorUpdateOne

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

AdministratorUpdateOne is the builder for updating a single Administrator entity.

func (*AdministratorUpdateOne) Exec

Exec executes the query on the entity.

func (*AdministratorUpdateOne) ExecX

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

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

func (*AdministratorUpdateOne) Mutation

Mutation returns the AdministratorMutation object of the builder.

func (*AdministratorUpdateOne) Save

Save executes the query and returns the updated Administrator entity.

func (*AdministratorUpdateOne) SaveX

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

func (*AdministratorUpdateOne) Select

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

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

func (*AdministratorUpdateOne) SetPassword

SetPassword sets the "password" field.

func (*AdministratorUpdateOne) SetUsername

SetUsername sets the "username" field.

type Administrators

type Administrators []*Administrator

Administrators is a parsable slice of Administrator.

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

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

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Administrator is the client for interacting with the Administrator builders.
	Administrator *AdministratorClient
	// DeletedVlanLog is the client for interacting with the DeletedVlanLog builders.
	DeletedVlanLog *DeletedVlanLogClient
	// Device is the client for interacting with the Device builders.
	Device *DeviceClient
	// DevicePlatform is the client for interacting with the DevicePlatform builders.
	DevicePlatform *DevicePlatformClient
	// DeviceType is the client for interacting with the DeviceType builders.
	DeviceType *DeviceTypeClient
	// IPAddress is the client for interacting with the IPAddress builders.
	IPAddress *IPAddressClient
	// IPStaticRoutingTable is the client for interacting with the IPStaticRoutingTable builders.
	IPStaticRoutingTable *IPStaticRoutingTableClient
	// NetInterface is the client for interacting with the NetInterface builders.
	NetInterface *NetInterfaceClient
	// NetInterfaceLayer is the client for interacting with the NetInterfaceLayer builders.
	NetInterfaceLayer *NetInterfaceLayerClient
	// NetInterfaceMode is the client for interacting with the NetInterfaceMode builders.
	NetInterfaceMode *NetInterfaceModeClient
	// NetTopology is the client for interacting with the NetTopology builders.
	NetTopology *NetTopologyClient
	// NetTopologyDeviceMap is the client for interacting with the NetTopologyDeviceMap builders.
	NetTopologyDeviceMap *NetTopologyDeviceMapClient
	// PortChannelInterface is the client for interacting with the PortChannelInterface builders.
	PortChannelInterface *PortChannelInterfaceClient
	// Vlan is the client for interacting with the Vlan builders.
	Vlan *VlanClient
	// 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().
	Administrator.
	Query().
	Count(ctx)

func (*Client) Tx

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

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

func (*Client) Use

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

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

type CommitFunc

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

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

func (CommitFunc) Commit

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

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

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

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

type Committer

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

Committer is the interface that wraps the Committer method.

type ConstraintError

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

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

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type DeletedVlanLog

type DeletedVlanLog struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// VlanID holds the value of the "vlan_id" field.
	VlanID int `json:"vlan_id,omitempty"`
	// Deleted holds the value of the "deleted" field.
	Deleted bool `json:"deleted,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the DeletedVlanLogQuery when eager-loading is set.
	Edges DeletedVlanLogEdges `json:"edges"`
	// contains filtered or unexported fields
}

DeletedVlanLog is the model entity for the DeletedVlanLog schema.

func (*DeletedVlanLog) QueryOnDevice

func (dvl *DeletedVlanLog) QueryOnDevice() *DeviceQuery

QueryOnDevice queries the "on_device" edge of the DeletedVlanLog entity.

func (*DeletedVlanLog) String

func (dvl *DeletedVlanLog) String() string

String implements the fmt.Stringer.

func (*DeletedVlanLog) Unwrap

func (dvl *DeletedVlanLog) Unwrap() *DeletedVlanLog

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

func (dvl *DeletedVlanLog) Update() *DeletedVlanLogUpdateOne

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

type DeletedVlanLogClient

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

DeletedVlanLogClient is a client for the DeletedVlanLog schema.

func NewDeletedVlanLogClient

func NewDeletedVlanLogClient(c config) *DeletedVlanLogClient

NewDeletedVlanLogClient returns a client for the DeletedVlanLog from the given config.

func (*DeletedVlanLogClient) Create

Create returns a create builder for DeletedVlanLog.

func (*DeletedVlanLogClient) CreateBulk

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

func (*DeletedVlanLogClient) Delete

Delete returns a delete builder for DeletedVlanLog.

func (*DeletedVlanLogClient) DeleteOne

DeleteOne returns a delete builder for the given entity.

func (*DeletedVlanLogClient) DeleteOneID

func (c *DeletedVlanLogClient) DeleteOneID(id int) *DeletedVlanLogDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*DeletedVlanLogClient) Get

Get returns a DeletedVlanLog entity by its id.

func (*DeletedVlanLogClient) GetX

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

func (*DeletedVlanLogClient) Hooks

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

Hooks returns the client hooks.

func (*DeletedVlanLogClient) Query

Query returns a query builder for DeletedVlanLog.

func (*DeletedVlanLogClient) QueryOnDevice

func (c *DeletedVlanLogClient) QueryOnDevice(dvl *DeletedVlanLog) *DeviceQuery

QueryOnDevice queries the on_device edge of a DeletedVlanLog.

func (*DeletedVlanLogClient) Update

Update returns an update builder for DeletedVlanLog.

func (*DeletedVlanLogClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*DeletedVlanLogClient) UpdateOneID

func (c *DeletedVlanLogClient) UpdateOneID(id int) *DeletedVlanLogUpdateOne

UpdateOneID returns an update builder for the given id.

func (*DeletedVlanLogClient) Use

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

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

type DeletedVlanLogCreate

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

DeletedVlanLogCreate is the builder for creating a DeletedVlanLog entity.

func (*DeletedVlanLogCreate) Mutation

func (dvlc *DeletedVlanLogCreate) Mutation() *DeletedVlanLogMutation

Mutation returns the DeletedVlanLogMutation object of the builder.

func (*DeletedVlanLogCreate) Save

Save creates the DeletedVlanLog in the database.

func (*DeletedVlanLogCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*DeletedVlanLogCreate) SetDeleted

func (dvlc *DeletedVlanLogCreate) SetDeleted(b bool) *DeletedVlanLogCreate

SetDeleted sets the "deleted" field.

func (*DeletedVlanLogCreate) SetNillableDeleted

func (dvlc *DeletedVlanLogCreate) SetNillableDeleted(b *bool) *DeletedVlanLogCreate

SetNillableDeleted sets the "deleted" field if the given value is not nil.

func (*DeletedVlanLogCreate) SetNillableOnDeviceID

func (dvlc *DeletedVlanLogCreate) SetNillableOnDeviceID(id *int) *DeletedVlanLogCreate

SetNillableOnDeviceID sets the "on_device" edge to the Device entity by ID if the given value is not nil.

func (*DeletedVlanLogCreate) SetOnDevice

func (dvlc *DeletedVlanLogCreate) SetOnDevice(d *Device) *DeletedVlanLogCreate

SetOnDevice sets the "on_device" edge to the Device entity.

func (*DeletedVlanLogCreate) SetOnDeviceID

func (dvlc *DeletedVlanLogCreate) SetOnDeviceID(id int) *DeletedVlanLogCreate

SetOnDeviceID sets the "on_device" edge to the Device entity by ID.

func (*DeletedVlanLogCreate) SetVlanID

func (dvlc *DeletedVlanLogCreate) SetVlanID(i int) *DeletedVlanLogCreate

SetVlanID sets the "vlan_id" field.

type DeletedVlanLogCreateBulk

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

DeletedVlanLogCreateBulk is the builder for creating many DeletedVlanLog entities in bulk.

func (*DeletedVlanLogCreateBulk) Save

Save creates the DeletedVlanLog entities in the database.

func (*DeletedVlanLogCreateBulk) SaveX

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

type DeletedVlanLogDelete

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

DeletedVlanLogDelete is the builder for deleting a DeletedVlanLog entity.

func (*DeletedVlanLogDelete) Exec

func (dvld *DeletedVlanLogDelete) Exec(ctx context.Context) (int, error)

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

func (*DeletedVlanLogDelete) ExecX

func (dvld *DeletedVlanLogDelete) ExecX(ctx context.Context) int

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

func (*DeletedVlanLogDelete) Where

Where adds a new predicate to the DeletedVlanLogDelete builder.

type DeletedVlanLogDeleteOne

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

DeletedVlanLogDeleteOne is the builder for deleting a single DeletedVlanLog entity.

func (*DeletedVlanLogDeleteOne) Exec

func (dvldo *DeletedVlanLogDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*DeletedVlanLogDeleteOne) ExecX

func (dvldo *DeletedVlanLogDeleteOne) ExecX(ctx context.Context)

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

type DeletedVlanLogEdges

type DeletedVlanLogEdges struct {
	// OnDevice holds the value of the on_device edge.
	OnDevice *Device `json:"on_device,omitempty"`
	// contains filtered or unexported fields
}

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

func (DeletedVlanLogEdges) OnDeviceOrErr

func (e DeletedVlanLogEdges) OnDeviceOrErr() (*Device, error)

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

type DeletedVlanLogGroupBy

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

DeletedVlanLogGroupBy is the group-by builder for DeletedVlanLog entities.

func (*DeletedVlanLogGroupBy) Aggregate

func (dvlgb *DeletedVlanLogGroupBy) Aggregate(fns ...AggregateFunc) *DeletedVlanLogGroupBy

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

func (*DeletedVlanLogGroupBy) Bool

func (dvlgb *DeletedVlanLogGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*DeletedVlanLogGroupBy) BoolX

func (dvlgb *DeletedVlanLogGroupBy) BoolX(ctx context.Context) bool

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

func (*DeletedVlanLogGroupBy) Bools

func (dvlgb *DeletedVlanLogGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*DeletedVlanLogGroupBy) BoolsX

func (dvlgb *DeletedVlanLogGroupBy) BoolsX(ctx context.Context) []bool

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

func (*DeletedVlanLogGroupBy) Float64

func (dvlgb *DeletedVlanLogGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*DeletedVlanLogGroupBy) Float64X

func (dvlgb *DeletedVlanLogGroupBy) Float64X(ctx context.Context) float64

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

func (*DeletedVlanLogGroupBy) Float64s

func (dvlgb *DeletedVlanLogGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*DeletedVlanLogGroupBy) Float64sX

func (dvlgb *DeletedVlanLogGroupBy) Float64sX(ctx context.Context) []float64

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

func (*DeletedVlanLogGroupBy) Int

func (dvlgb *DeletedVlanLogGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*DeletedVlanLogGroupBy) IntX

func (dvlgb *DeletedVlanLogGroupBy) IntX(ctx context.Context) int

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

func (*DeletedVlanLogGroupBy) Ints

func (dvlgb *DeletedVlanLogGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*DeletedVlanLogGroupBy) IntsX

func (dvlgb *DeletedVlanLogGroupBy) IntsX(ctx context.Context) []int

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

func (*DeletedVlanLogGroupBy) Scan

func (dvlgb *DeletedVlanLogGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*DeletedVlanLogGroupBy) ScanX

func (dvlgb *DeletedVlanLogGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*DeletedVlanLogGroupBy) String

func (dvlgb *DeletedVlanLogGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*DeletedVlanLogGroupBy) StringX

func (dvlgb *DeletedVlanLogGroupBy) StringX(ctx context.Context) string

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

func (*DeletedVlanLogGroupBy) Strings

func (dvlgb *DeletedVlanLogGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*DeletedVlanLogGroupBy) StringsX

func (dvlgb *DeletedVlanLogGroupBy) StringsX(ctx context.Context) []string

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

type DeletedVlanLogMutation

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

DeletedVlanLogMutation represents an operation that mutates the DeletedVlanLog nodes in the graph.

func (*DeletedVlanLogMutation) AddField

func (m *DeletedVlanLogMutation) 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 (*DeletedVlanLogMutation) AddVlanID

func (m *DeletedVlanLogMutation) AddVlanID(i int)

AddVlanID adds i to the "vlan_id" field.

func (*DeletedVlanLogMutation) AddedEdges

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

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

func (*DeletedVlanLogMutation) AddedField

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

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

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

func (*DeletedVlanLogMutation) AddedIDs

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

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

func (*DeletedVlanLogMutation) AddedVlanID

func (m *DeletedVlanLogMutation) AddedVlanID() (r int, exists bool)

AddedVlanID returns the value that was added to the "vlan_id" field in this mutation.

func (*DeletedVlanLogMutation) ClearEdge

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

func (m *DeletedVlanLogMutation) 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 (*DeletedVlanLogMutation) ClearOnDevice

func (m *DeletedVlanLogMutation) ClearOnDevice()

ClearOnDevice clears the "on_device" edge to the Device entity.

func (*DeletedVlanLogMutation) ClearedEdges

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

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

func (*DeletedVlanLogMutation) ClearedFields

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

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

func (DeletedVlanLogMutation) Client

func (m DeletedVlanLogMutation) 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 (*DeletedVlanLogMutation) Deleted

func (m *DeletedVlanLogMutation) Deleted() (r bool, exists bool)

Deleted returns the value of the "deleted" field in the mutation.

func (*DeletedVlanLogMutation) EdgeCleared

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

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

func (*DeletedVlanLogMutation) Field

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

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

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

func (*DeletedVlanLogMutation) Fields

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

func (m *DeletedVlanLogMutation) 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.

func (*DeletedVlanLogMutation) OldDeleted

func (m *DeletedVlanLogMutation) OldDeleted(ctx context.Context) (v bool, err error)

OldDeleted returns the old "deleted" field's value of the DeletedVlanLog entity. If the DeletedVlanLog 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 (*DeletedVlanLogMutation) OldField

func (m *DeletedVlanLogMutation) 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 (*DeletedVlanLogMutation) OldVlanID

func (m *DeletedVlanLogMutation) OldVlanID(ctx context.Context) (v int, err error)

OldVlanID returns the old "vlan_id" field's value of the DeletedVlanLog entity. If the DeletedVlanLog 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 (*DeletedVlanLogMutation) OnDeviceCleared

func (m *DeletedVlanLogMutation) OnDeviceCleared() bool

OnDeviceCleared reports if the "on_device" edge to the Device entity was cleared.

func (*DeletedVlanLogMutation) OnDeviceID

func (m *DeletedVlanLogMutation) OnDeviceID() (id int, exists bool)

OnDeviceID returns the "on_device" edge ID in the mutation.

func (*DeletedVlanLogMutation) OnDeviceIDs

func (m *DeletedVlanLogMutation) OnDeviceIDs() (ids []int)

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

func (*DeletedVlanLogMutation) Op

func (m *DeletedVlanLogMutation) Op() Op

Op returns the operation name.

func (*DeletedVlanLogMutation) RemovedEdges

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

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

func (*DeletedVlanLogMutation) RemovedIDs

func (m *DeletedVlanLogMutation) 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 (*DeletedVlanLogMutation) ResetDeleted

func (m *DeletedVlanLogMutation) ResetDeleted()

ResetDeleted resets all changes to the "deleted" field.

func (*DeletedVlanLogMutation) ResetEdge

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

func (m *DeletedVlanLogMutation) 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 (*DeletedVlanLogMutation) ResetOnDevice

func (m *DeletedVlanLogMutation) ResetOnDevice()

ResetOnDevice resets all changes to the "on_device" edge.

func (*DeletedVlanLogMutation) ResetVlanID

func (m *DeletedVlanLogMutation) ResetVlanID()

ResetVlanID resets all changes to the "vlan_id" field.

func (*DeletedVlanLogMutation) SetDeleted

func (m *DeletedVlanLogMutation) SetDeleted(b bool)

SetDeleted sets the "deleted" field.

func (*DeletedVlanLogMutation) SetField

func (m *DeletedVlanLogMutation) 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 (*DeletedVlanLogMutation) SetOnDeviceID

func (m *DeletedVlanLogMutation) SetOnDeviceID(id int)

SetOnDeviceID sets the "on_device" edge to the Device entity by id.

func (*DeletedVlanLogMutation) SetVlanID

func (m *DeletedVlanLogMutation) SetVlanID(i int)

SetVlanID sets the "vlan_id" field.

func (DeletedVlanLogMutation) Tx

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

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

func (*DeletedVlanLogMutation) Type

func (m *DeletedVlanLogMutation) Type() string

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

func (*DeletedVlanLogMutation) VlanID

func (m *DeletedVlanLogMutation) VlanID() (r int, exists bool)

VlanID returns the value of the "vlan_id" field in the mutation.

type DeletedVlanLogQuery

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

DeletedVlanLogQuery is the builder for querying DeletedVlanLog entities.

func (*DeletedVlanLogQuery) All

All executes the query and returns a list of DeletedVlanLogs.

func (*DeletedVlanLogQuery) AllX

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

func (*DeletedVlanLogQuery) Clone

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

func (*DeletedVlanLogQuery) Count

func (dvlq *DeletedVlanLogQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*DeletedVlanLogQuery) CountX

func (dvlq *DeletedVlanLogQuery) CountX(ctx context.Context) int

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

func (*DeletedVlanLogQuery) Exist

func (dvlq *DeletedVlanLogQuery) Exist(ctx context.Context) (bool, error)

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

func (*DeletedVlanLogQuery) ExistX

func (dvlq *DeletedVlanLogQuery) ExistX(ctx context.Context) bool

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

func (*DeletedVlanLogQuery) First

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

func (*DeletedVlanLogQuery) FirstID

func (dvlq *DeletedVlanLogQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*DeletedVlanLogQuery) FirstIDX

func (dvlq *DeletedVlanLogQuery) FirstIDX(ctx context.Context) int

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

func (*DeletedVlanLogQuery) FirstX

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

func (*DeletedVlanLogQuery) GroupBy

func (dvlq *DeletedVlanLogQuery) GroupBy(field string, fields ...string) *DeletedVlanLogGroupBy

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 {
	VlanID int `json:"vlan_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.DeletedVlanLog.Query().
	GroupBy(deletedvlanlog.FieldVlanID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*DeletedVlanLogQuery) IDs

func (dvlq *DeletedVlanLogQuery) IDs(ctx context.Context) ([]int, error)

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

func (*DeletedVlanLogQuery) IDsX

func (dvlq *DeletedVlanLogQuery) IDsX(ctx context.Context) []int

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

func (*DeletedVlanLogQuery) Limit

func (dvlq *DeletedVlanLogQuery) Limit(limit int) *DeletedVlanLogQuery

Limit adds a limit step to the query.

func (*DeletedVlanLogQuery) Offset

func (dvlq *DeletedVlanLogQuery) Offset(offset int) *DeletedVlanLogQuery

Offset adds an offset step to the query.

func (*DeletedVlanLogQuery) Only

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

func (*DeletedVlanLogQuery) OnlyID

func (dvlq *DeletedVlanLogQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*DeletedVlanLogQuery) OnlyIDX

func (dvlq *DeletedVlanLogQuery) OnlyIDX(ctx context.Context) int

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

func (*DeletedVlanLogQuery) OnlyX

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

func (*DeletedVlanLogQuery) Order

Order adds an order step to the query.

func (*DeletedVlanLogQuery) QueryOnDevice

func (dvlq *DeletedVlanLogQuery) QueryOnDevice() *DeviceQuery

QueryOnDevice chains the current query on the "on_device" edge.

func (*DeletedVlanLogQuery) Select

func (dvlq *DeletedVlanLogQuery) Select(field string, fields ...string) *DeletedVlanLogSelect

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 {
	VlanID int `json:"vlan_id,omitempty"`
}

client.DeletedVlanLog.Query().
	Select(deletedvlanlog.FieldVlanID).
	Scan(ctx, &v)

func (*DeletedVlanLogQuery) Unique

func (dvlq *DeletedVlanLogQuery) Unique(unique bool) *DeletedVlanLogQuery

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

Where adds a new predicate for the DeletedVlanLogQuery builder.

func (*DeletedVlanLogQuery) WithOnDevice

func (dvlq *DeletedVlanLogQuery) WithOnDevice(opts ...func(*DeviceQuery)) *DeletedVlanLogQuery

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

type DeletedVlanLogSelect

type DeletedVlanLogSelect struct {
	*DeletedVlanLogQuery
	// contains filtered or unexported fields
}

DeletedVlanLogSelect is the builder for selecting fields of DeletedVlanLog entities.

func (*DeletedVlanLogSelect) Bool

func (dvls *DeletedVlanLogSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*DeletedVlanLogSelect) BoolX

func (dvls *DeletedVlanLogSelect) BoolX(ctx context.Context) bool

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

func (*DeletedVlanLogSelect) Bools

func (dvls *DeletedVlanLogSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*DeletedVlanLogSelect) BoolsX

func (dvls *DeletedVlanLogSelect) BoolsX(ctx context.Context) []bool

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

func (*DeletedVlanLogSelect) Float64

func (dvls *DeletedVlanLogSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*DeletedVlanLogSelect) Float64X

func (dvls *DeletedVlanLogSelect) Float64X(ctx context.Context) float64

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

func (*DeletedVlanLogSelect) Float64s

func (dvls *DeletedVlanLogSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*DeletedVlanLogSelect) Float64sX

func (dvls *DeletedVlanLogSelect) Float64sX(ctx context.Context) []float64

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

func (*DeletedVlanLogSelect) Int

func (dvls *DeletedVlanLogSelect) Int(ctx context.Context) (_ int, err error)

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

func (*DeletedVlanLogSelect) IntX

func (dvls *DeletedVlanLogSelect) IntX(ctx context.Context) int

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

func (*DeletedVlanLogSelect) Ints

func (dvls *DeletedVlanLogSelect) Ints(ctx context.Context) ([]int, error)

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

func (*DeletedVlanLogSelect) IntsX

func (dvls *DeletedVlanLogSelect) IntsX(ctx context.Context) []int

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

func (*DeletedVlanLogSelect) Scan

func (dvls *DeletedVlanLogSelect) Scan(ctx context.Context, v interface{}) error

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

func (*DeletedVlanLogSelect) ScanX

func (dvls *DeletedVlanLogSelect) ScanX(ctx context.Context, v interface{})

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

func (*DeletedVlanLogSelect) String

func (dvls *DeletedVlanLogSelect) String(ctx context.Context) (_ string, err error)

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

func (*DeletedVlanLogSelect) StringX

func (dvls *DeletedVlanLogSelect) StringX(ctx context.Context) string

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

func (*DeletedVlanLogSelect) Strings

func (dvls *DeletedVlanLogSelect) Strings(ctx context.Context) ([]string, error)

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

func (*DeletedVlanLogSelect) StringsX

func (dvls *DeletedVlanLogSelect) StringsX(ctx context.Context) []string

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

type DeletedVlanLogUpdate

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

DeletedVlanLogUpdate is the builder for updating DeletedVlanLog entities.

func (*DeletedVlanLogUpdate) AddVlanID

func (dvlu *DeletedVlanLogUpdate) AddVlanID(i int) *DeletedVlanLogUpdate

AddVlanID adds i to the "vlan_id" field.

func (*DeletedVlanLogUpdate) ClearOnDevice

func (dvlu *DeletedVlanLogUpdate) ClearOnDevice() *DeletedVlanLogUpdate

ClearOnDevice clears the "on_device" edge to the Device entity.

func (*DeletedVlanLogUpdate) Exec

func (dvlu *DeletedVlanLogUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*DeletedVlanLogUpdate) ExecX

func (dvlu *DeletedVlanLogUpdate) ExecX(ctx context.Context)

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

func (*DeletedVlanLogUpdate) Mutation

func (dvlu *DeletedVlanLogUpdate) Mutation() *DeletedVlanLogMutation

Mutation returns the DeletedVlanLogMutation object of the builder.

func (*DeletedVlanLogUpdate) Save

func (dvlu *DeletedVlanLogUpdate) Save(ctx context.Context) (int, error)

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

func (*DeletedVlanLogUpdate) SaveX

func (dvlu *DeletedVlanLogUpdate) SaveX(ctx context.Context) int

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

func (*DeletedVlanLogUpdate) SetDeleted

func (dvlu *DeletedVlanLogUpdate) SetDeleted(b bool) *DeletedVlanLogUpdate

SetDeleted sets the "deleted" field.

func (*DeletedVlanLogUpdate) SetNillableDeleted

func (dvlu *DeletedVlanLogUpdate) SetNillableDeleted(b *bool) *DeletedVlanLogUpdate

SetNillableDeleted sets the "deleted" field if the given value is not nil.

func (*DeletedVlanLogUpdate) SetNillableOnDeviceID

func (dvlu *DeletedVlanLogUpdate) SetNillableOnDeviceID(id *int) *DeletedVlanLogUpdate

SetNillableOnDeviceID sets the "on_device" edge to the Device entity by ID if the given value is not nil.

func (*DeletedVlanLogUpdate) SetOnDevice

func (dvlu *DeletedVlanLogUpdate) SetOnDevice(d *Device) *DeletedVlanLogUpdate

SetOnDevice sets the "on_device" edge to the Device entity.

func (*DeletedVlanLogUpdate) SetOnDeviceID

func (dvlu *DeletedVlanLogUpdate) SetOnDeviceID(id int) *DeletedVlanLogUpdate

SetOnDeviceID sets the "on_device" edge to the Device entity by ID.

func (*DeletedVlanLogUpdate) SetVlanID

func (dvlu *DeletedVlanLogUpdate) SetVlanID(i int) *DeletedVlanLogUpdate

SetVlanID sets the "vlan_id" field.

func (*DeletedVlanLogUpdate) Where

Where adds a new predicate for the DeletedVlanLogUpdate builder.

type DeletedVlanLogUpdateOne

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

DeletedVlanLogUpdateOne is the builder for updating a single DeletedVlanLog entity.

func (*DeletedVlanLogUpdateOne) AddVlanID

AddVlanID adds i to the "vlan_id" field.

func (*DeletedVlanLogUpdateOne) ClearOnDevice

func (dvluo *DeletedVlanLogUpdateOne) ClearOnDevice() *DeletedVlanLogUpdateOne

ClearOnDevice clears the "on_device" edge to the Device entity.

func (*DeletedVlanLogUpdateOne) Exec

func (dvluo *DeletedVlanLogUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*DeletedVlanLogUpdateOne) ExecX

func (dvluo *DeletedVlanLogUpdateOne) ExecX(ctx context.Context)

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

func (*DeletedVlanLogUpdateOne) Mutation

Mutation returns the DeletedVlanLogMutation object of the builder.

func (*DeletedVlanLogUpdateOne) Save

Save executes the query and returns the updated DeletedVlanLog entity.

func (*DeletedVlanLogUpdateOne) SaveX

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

func (*DeletedVlanLogUpdateOne) Select

func (dvluo *DeletedVlanLogUpdateOne) Select(field string, fields ...string) *DeletedVlanLogUpdateOne

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

func (*DeletedVlanLogUpdateOne) SetDeleted

SetDeleted sets the "deleted" field.

func (*DeletedVlanLogUpdateOne) SetNillableDeleted

func (dvluo *DeletedVlanLogUpdateOne) SetNillableDeleted(b *bool) *DeletedVlanLogUpdateOne

SetNillableDeleted sets the "deleted" field if the given value is not nil.

func (*DeletedVlanLogUpdateOne) SetNillableOnDeviceID

func (dvluo *DeletedVlanLogUpdateOne) SetNillableOnDeviceID(id *int) *DeletedVlanLogUpdateOne

SetNillableOnDeviceID sets the "on_device" edge to the Device entity by ID if the given value is not nil.

func (*DeletedVlanLogUpdateOne) SetOnDevice

func (dvluo *DeletedVlanLogUpdateOne) SetOnDevice(d *Device) *DeletedVlanLogUpdateOne

SetOnDevice sets the "on_device" edge to the Device entity.

func (*DeletedVlanLogUpdateOne) SetOnDeviceID

func (dvluo *DeletedVlanLogUpdateOne) SetOnDeviceID(id int) *DeletedVlanLogUpdateOne

SetOnDeviceID sets the "on_device" edge to the Device entity by ID.

func (*DeletedVlanLogUpdateOne) SetVlanID

SetVlanID sets the "vlan_id" field.

type DeletedVlanLogs

type DeletedVlanLogs []*DeletedVlanLog

DeletedVlanLogs is a parsable slice of DeletedVlanLog.

type Device

type Device struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// DeviceName holds the value of the "device_name" field.
	DeviceName string `json:"device_name,omitempty"`
	// DeviceHostname holds the value of the "device_hostname" field.
	DeviceHostname string `json:"device_hostname,omitempty"`
	// DeviceUsername holds the value of the "device_username" field.
	DeviceUsername string `json:"device_username,omitempty"`
	// DevicePassword holds the value of the "device_password" field.
	DevicePassword string `json:"device_password,omitempty"`
	// DeviceSecret holds the value of the "device_secret" field.
	DeviceSecret string `json:"device_secret,omitempty"`
	// DeviceSSHPort holds the value of the "device_ssh_port" field.
	DeviceSSHPort int `json:"device_ssh_port,omitempty"`
	// DeviceCommitConfig holds the value of the "device_commit_config" field.
	DeviceCommitConfig bool `json:"device_commit_config,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the DeviceQuery when eager-loading is set.
	Edges DeviceEdges `json:"edges"`
	// contains filtered or unexported fields
}

Device is the model entity for the Device schema.

func (*Device) QueryDeletedVlans

func (d *Device) QueryDeletedVlans() *DeletedVlanLogQuery

QueryDeletedVlans queries the "deleted_vlans" edge of the Device entity.

func (*Device) QueryHaveIPAddresses added in v0.2.0

func (d *Device) QueryHaveIPAddresses() *IPAddressQuery

QueryHaveIPAddresses queries the "have_ip_addresses" edge of the Device entity.

func (*Device) QueryIPStaticRouting added in v0.2.0

func (d *Device) QueryIPStaticRouting() *IPStaticRoutingTableQuery

QueryIPStaticRouting queries the "ip_static_routing" edge of the Device entity.

func (*Device) QueryInPlatform

func (d *Device) QueryInPlatform() *DevicePlatformQuery

QueryInPlatform queries the "in_platform" edge of the Device entity.

func (*Device) QueryInTopology

func (d *Device) QueryInTopology() *NetTopologyDeviceMapQuery

QueryInTopology queries the "in_topology" edge of the Device entity.

func (*Device) QueryInType

func (d *Device) QueryInType() *DeviceTypeQuery

QueryInType queries the "in_type" edge of the Device entity.

func (*Device) QueryInterfaces

func (d *Device) QueryInterfaces() *NetInterfaceQuery

QueryInterfaces queries the "interfaces" edge of the Device entity.

func (*Device) QueryPoInterfaces added in v0.2.0

func (d *Device) QueryPoInterfaces() *PortChannelInterfaceQuery

QueryPoInterfaces queries the "po_interfaces" edge of the Device entity.

func (*Device) QueryStoreVlans

func (d *Device) QueryStoreVlans() *VlanQuery

QueryStoreVlans queries the "store_vlans" edge of the Device entity.

func (*Device) String

func (d *Device) String() string

String implements the fmt.Stringer.

func (*Device) Unwrap

func (d *Device) Unwrap() *Device

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

func (d *Device) Update() *DeviceUpdateOne

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

type DeviceClient

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

DeviceClient is a client for the Device schema.

func NewDeviceClient

func NewDeviceClient(c config) *DeviceClient

NewDeviceClient returns a client for the Device from the given config.

func (*DeviceClient) Create

func (c *DeviceClient) Create() *DeviceCreate

Create returns a create builder for Device.

func (*DeviceClient) CreateBulk

func (c *DeviceClient) CreateBulk(builders ...*DeviceCreate) *DeviceCreateBulk

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

func (*DeviceClient) Delete

func (c *DeviceClient) Delete() *DeviceDelete

Delete returns a delete builder for Device.

func (*DeviceClient) DeleteOne

func (c *DeviceClient) DeleteOne(d *Device) *DeviceDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*DeviceClient) DeleteOneID

func (c *DeviceClient) DeleteOneID(id int) *DeviceDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*DeviceClient) Get

func (c *DeviceClient) Get(ctx context.Context, id int) (*Device, error)

Get returns a Device entity by its id.

func (*DeviceClient) GetX

func (c *DeviceClient) GetX(ctx context.Context, id int) *Device

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

func (*DeviceClient) Hooks

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

Hooks returns the client hooks.

func (*DeviceClient) Query

func (c *DeviceClient) Query() *DeviceQuery

Query returns a query builder for Device.

func (*DeviceClient) QueryDeletedVlans

func (c *DeviceClient) QueryDeletedVlans(d *Device) *DeletedVlanLogQuery

QueryDeletedVlans queries the deleted_vlans edge of a Device.

func (*DeviceClient) QueryHaveIPAddresses added in v0.2.0

func (c *DeviceClient) QueryHaveIPAddresses(d *Device) *IPAddressQuery

QueryHaveIPAddresses queries the have_ip_addresses edge of a Device.

func (*DeviceClient) QueryIPStaticRouting added in v0.2.0

func (c *DeviceClient) QueryIPStaticRouting(d *Device) *IPStaticRoutingTableQuery

QueryIPStaticRouting queries the ip_static_routing edge of a Device.

func (*DeviceClient) QueryInPlatform

func (c *DeviceClient) QueryInPlatform(d *Device) *DevicePlatformQuery

QueryInPlatform queries the in_platform edge of a Device.

func (*DeviceClient) QueryInTopology

func (c *DeviceClient) QueryInTopology(d *Device) *NetTopologyDeviceMapQuery

QueryInTopology queries the in_topology edge of a Device.

func (*DeviceClient) QueryInType

func (c *DeviceClient) QueryInType(d *Device) *DeviceTypeQuery

QueryInType queries the in_type edge of a Device.

func (*DeviceClient) QueryInterfaces

func (c *DeviceClient) QueryInterfaces(d *Device) *NetInterfaceQuery

QueryInterfaces queries the interfaces edge of a Device.

func (*DeviceClient) QueryPoInterfaces added in v0.2.0

func (c *DeviceClient) QueryPoInterfaces(d *Device) *PortChannelInterfaceQuery

QueryPoInterfaces queries the po_interfaces edge of a Device.

func (*DeviceClient) QueryStoreVlans

func (c *DeviceClient) QueryStoreVlans(d *Device) *VlanQuery

QueryStoreVlans queries the store_vlans edge of a Device.

func (*DeviceClient) Update

func (c *DeviceClient) Update() *DeviceUpdate

Update returns an update builder for Device.

func (*DeviceClient) UpdateOne

func (c *DeviceClient) UpdateOne(d *Device) *DeviceUpdateOne

UpdateOne returns an update builder for the given entity.

func (*DeviceClient) UpdateOneID

func (c *DeviceClient) UpdateOneID(id int) *DeviceUpdateOne

UpdateOneID returns an update builder for the given id.

func (*DeviceClient) Use

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

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

type DeviceCreate

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

DeviceCreate is the builder for creating a Device entity.

func (*DeviceCreate) AddDeletedVlanIDs

func (dc *DeviceCreate) AddDeletedVlanIDs(ids ...int) *DeviceCreate

AddDeletedVlanIDs adds the "deleted_vlans" edge to the DeletedVlanLog entity by IDs.

func (*DeviceCreate) AddDeletedVlans

func (dc *DeviceCreate) AddDeletedVlans(d ...*DeletedVlanLog) *DeviceCreate

AddDeletedVlans adds the "deleted_vlans" edges to the DeletedVlanLog entity.

func (*DeviceCreate) AddHaveIPAddressIDs added in v0.2.0

func (dc *DeviceCreate) AddHaveIPAddressIDs(ids ...int) *DeviceCreate

AddHaveIPAddressIDs adds the "have_ip_addresses" edge to the IPAddress entity by IDs.

func (*DeviceCreate) AddHaveIPAddresses added in v0.2.0

func (dc *DeviceCreate) AddHaveIPAddresses(i ...*IPAddress) *DeviceCreate

AddHaveIPAddresses adds the "have_ip_addresses" edges to the IPAddress entity.

func (*DeviceCreate) AddIPStaticRouting added in v0.2.0

func (dc *DeviceCreate) AddIPStaticRouting(i ...*IPStaticRoutingTable) *DeviceCreate

AddIPStaticRouting adds the "ip_static_routing" edges to the IPStaticRoutingTable entity.

func (*DeviceCreate) AddIPStaticRoutingIDs added in v0.2.0

func (dc *DeviceCreate) AddIPStaticRoutingIDs(ids ...int) *DeviceCreate

AddIPStaticRoutingIDs adds the "ip_static_routing" edge to the IPStaticRoutingTable entity by IDs.

func (*DeviceCreate) AddInTopology

func (dc *DeviceCreate) AddInTopology(n ...*NetTopologyDeviceMap) *DeviceCreate

AddInTopology adds the "in_topology" edges to the NetTopologyDeviceMap entity.

func (*DeviceCreate) AddInTopologyIDs

func (dc *DeviceCreate) AddInTopologyIDs(ids ...int) *DeviceCreate

AddInTopologyIDs adds the "in_topology" edge to the NetTopologyDeviceMap entity by IDs.

func (*DeviceCreate) AddInterfaceIDs

func (dc *DeviceCreate) AddInterfaceIDs(ids ...int) *DeviceCreate

AddInterfaceIDs adds the "interfaces" edge to the NetInterface entity by IDs.

func (*DeviceCreate) AddInterfaces

func (dc *DeviceCreate) AddInterfaces(n ...*NetInterface) *DeviceCreate

AddInterfaces adds the "interfaces" edges to the NetInterface entity.

func (*DeviceCreate) AddPoInterfaceIDs added in v0.2.0

func (dc *DeviceCreate) AddPoInterfaceIDs(ids ...int) *DeviceCreate

AddPoInterfaceIDs adds the "po_interfaces" edge to the PortChannelInterface entity by IDs.

func (*DeviceCreate) AddPoInterfaces added in v0.2.0

func (dc *DeviceCreate) AddPoInterfaces(p ...*PortChannelInterface) *DeviceCreate

AddPoInterfaces adds the "po_interfaces" edges to the PortChannelInterface entity.

func (*DeviceCreate) AddStoreVlanIDs

func (dc *DeviceCreate) AddStoreVlanIDs(ids ...int) *DeviceCreate

AddStoreVlanIDs adds the "store_vlans" edge to the Vlan entity by IDs.

func (*DeviceCreate) AddStoreVlans

func (dc *DeviceCreate) AddStoreVlans(v ...*Vlan) *DeviceCreate

AddStoreVlans adds the "store_vlans" edges to the Vlan entity.

func (*DeviceCreate) Mutation

func (dc *DeviceCreate) Mutation() *DeviceMutation

Mutation returns the DeviceMutation object of the builder.

func (*DeviceCreate) Save

func (dc *DeviceCreate) Save(ctx context.Context) (*Device, error)

Save creates the Device in the database.

func (*DeviceCreate) SaveX

func (dc *DeviceCreate) SaveX(ctx context.Context) *Device

SaveX calls Save and panics if Save returns an error.

func (*DeviceCreate) SetDeviceCommitConfig

func (dc *DeviceCreate) SetDeviceCommitConfig(b bool) *DeviceCreate

SetDeviceCommitConfig sets the "device_commit_config" field.

func (*DeviceCreate) SetDeviceHostname

func (dc *DeviceCreate) SetDeviceHostname(s string) *DeviceCreate

SetDeviceHostname sets the "device_hostname" field.

func (*DeviceCreate) SetDeviceName

func (dc *DeviceCreate) SetDeviceName(s string) *DeviceCreate

SetDeviceName sets the "device_name" field.

func (*DeviceCreate) SetDevicePassword

func (dc *DeviceCreate) SetDevicePassword(s string) *DeviceCreate

SetDevicePassword sets the "device_password" field.

func (*DeviceCreate) SetDeviceSSHPort

func (dc *DeviceCreate) SetDeviceSSHPort(i int) *DeviceCreate

SetDeviceSSHPort sets the "device_ssh_port" field.

func (*DeviceCreate) SetDeviceSecret

func (dc *DeviceCreate) SetDeviceSecret(s string) *DeviceCreate

SetDeviceSecret sets the "device_secret" field.

func (*DeviceCreate) SetDeviceUsername

func (dc *DeviceCreate) SetDeviceUsername(s string) *DeviceCreate

SetDeviceUsername sets the "device_username" field.

func (*DeviceCreate) SetInPlatform

func (dc *DeviceCreate) SetInPlatform(d *DevicePlatform) *DeviceCreate

SetInPlatform sets the "in_platform" edge to the DevicePlatform entity.

func (*DeviceCreate) SetInPlatformID

func (dc *DeviceCreate) SetInPlatformID(id int) *DeviceCreate

SetInPlatformID sets the "in_platform" edge to the DevicePlatform entity by ID.

func (*DeviceCreate) SetInType

func (dc *DeviceCreate) SetInType(d *DeviceType) *DeviceCreate

SetInType sets the "in_type" edge to the DeviceType entity.

func (*DeviceCreate) SetInTypeID

func (dc *DeviceCreate) SetInTypeID(id int) *DeviceCreate

SetInTypeID sets the "in_type" edge to the DeviceType entity by ID.

func (*DeviceCreate) SetNillableDeviceCommitConfig

func (dc *DeviceCreate) SetNillableDeviceCommitConfig(b *bool) *DeviceCreate

SetNillableDeviceCommitConfig sets the "device_commit_config" field if the given value is not nil.

func (*DeviceCreate) SetNillableDevicePassword

func (dc *DeviceCreate) SetNillableDevicePassword(s *string) *DeviceCreate

SetNillableDevicePassword sets the "device_password" field if the given value is not nil.

func (*DeviceCreate) SetNillableDeviceSSHPort

func (dc *DeviceCreate) SetNillableDeviceSSHPort(i *int) *DeviceCreate

SetNillableDeviceSSHPort sets the "device_ssh_port" field if the given value is not nil.

func (*DeviceCreate) SetNillableDeviceSecret

func (dc *DeviceCreate) SetNillableDeviceSecret(s *string) *DeviceCreate

SetNillableDeviceSecret sets the "device_secret" field if the given value is not nil.

func (*DeviceCreate) SetNillableDeviceUsername

func (dc *DeviceCreate) SetNillableDeviceUsername(s *string) *DeviceCreate

SetNillableDeviceUsername sets the "device_username" field if the given value is not nil.

func (*DeviceCreate) SetNillableInPlatformID

func (dc *DeviceCreate) SetNillableInPlatformID(id *int) *DeviceCreate

SetNillableInPlatformID sets the "in_platform" edge to the DevicePlatform entity by ID if the given value is not nil.

func (*DeviceCreate) SetNillableInTypeID

func (dc *DeviceCreate) SetNillableInTypeID(id *int) *DeviceCreate

SetNillableInTypeID sets the "in_type" edge to the DeviceType entity by ID if the given value is not nil.

type DeviceCreateBulk

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

DeviceCreateBulk is the builder for creating many Device entities in bulk.

func (*DeviceCreateBulk) Save

func (dcb *DeviceCreateBulk) Save(ctx context.Context) ([]*Device, error)

Save creates the Device entities in the database.

func (*DeviceCreateBulk) SaveX

func (dcb *DeviceCreateBulk) SaveX(ctx context.Context) []*Device

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

type DeviceDelete

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

DeviceDelete is the builder for deleting a Device entity.

func (*DeviceDelete) Exec

func (dd *DeviceDelete) Exec(ctx context.Context) (int, error)

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

func (*DeviceDelete) ExecX

func (dd *DeviceDelete) ExecX(ctx context.Context) int

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

func (*DeviceDelete) Where

func (dd *DeviceDelete) Where(ps ...predicate.Device) *DeviceDelete

Where adds a new predicate to the DeviceDelete builder.

type DeviceDeleteOne

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

DeviceDeleteOne is the builder for deleting a single Device entity.

func (*DeviceDeleteOne) Exec

func (ddo *DeviceDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*DeviceDeleteOne) ExecX

func (ddo *DeviceDeleteOne) ExecX(ctx context.Context)

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

type DeviceEdges

type DeviceEdges struct {
	// InType holds the value of the in_type edge.
	InType *DeviceType `json:"in_type,omitempty"`
	// InPlatform holds the value of the in_platform edge.
	InPlatform *DevicePlatform `json:"in_platform,omitempty"`
	// Interfaces holds the value of the interfaces edge.
	Interfaces []*NetInterface `json:"interfaces,omitempty"`
	// IPStaticRouting holds the value of the ip_static_routing edge.
	IPStaticRouting []*IPStaticRoutingTable `json:"ip_static_routing,omitempty"`
	// PoInterfaces holds the value of the po_interfaces edge.
	PoInterfaces []*PortChannelInterface `json:"po_interfaces,omitempty"`
	// HaveIPAddresses holds the value of the have_ip_addresses edge.
	HaveIPAddresses []*IPAddress `json:"have_ip_addresses,omitempty"`
	// InTopology holds the value of the in_topology edge.
	InTopology []*NetTopologyDeviceMap `json:"in_topology,omitempty"`
	// StoreVlans holds the value of the store_vlans edge.
	StoreVlans []*Vlan `json:"store_vlans,omitempty"`
	// DeletedVlans holds the value of the deleted_vlans edge.
	DeletedVlans []*DeletedVlanLog `json:"deleted_vlans,omitempty"`
	// contains filtered or unexported fields
}

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

func (DeviceEdges) DeletedVlansOrErr

func (e DeviceEdges) DeletedVlansOrErr() ([]*DeletedVlanLog, error)

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

func (DeviceEdges) HaveIPAddressesOrErr added in v0.2.0

func (e DeviceEdges) HaveIPAddressesOrErr() ([]*IPAddress, error)

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

func (DeviceEdges) IPStaticRoutingOrErr added in v0.2.0

func (e DeviceEdges) IPStaticRoutingOrErr() ([]*IPStaticRoutingTable, error)

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

func (DeviceEdges) InPlatformOrErr

func (e DeviceEdges) InPlatformOrErr() (*DevicePlatform, error)

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

func (DeviceEdges) InTopologyOrErr

func (e DeviceEdges) InTopologyOrErr() ([]*NetTopologyDeviceMap, error)

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

func (DeviceEdges) InTypeOrErr

func (e DeviceEdges) InTypeOrErr() (*DeviceType, error)

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

func (DeviceEdges) InterfacesOrErr

func (e DeviceEdges) InterfacesOrErr() ([]*NetInterface, error)

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

func (DeviceEdges) PoInterfacesOrErr added in v0.2.0

func (e DeviceEdges) PoInterfacesOrErr() ([]*PortChannelInterface, error)

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

func (DeviceEdges) StoreVlansOrErr

func (e DeviceEdges) StoreVlansOrErr() ([]*Vlan, error)

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

type DeviceGroupBy

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

DeviceGroupBy is the group-by builder for Device entities.

func (*DeviceGroupBy) Aggregate

func (dgb *DeviceGroupBy) Aggregate(fns ...AggregateFunc) *DeviceGroupBy

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

func (*DeviceGroupBy) Bool

func (dgb *DeviceGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*DeviceGroupBy) BoolX

func (dgb *DeviceGroupBy) BoolX(ctx context.Context) bool

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

func (*DeviceGroupBy) Bools

func (dgb *DeviceGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*DeviceGroupBy) BoolsX

func (dgb *DeviceGroupBy) BoolsX(ctx context.Context) []bool

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

func (*DeviceGroupBy) Float64

func (dgb *DeviceGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*DeviceGroupBy) Float64X

func (dgb *DeviceGroupBy) Float64X(ctx context.Context) float64

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

func (*DeviceGroupBy) Float64s

func (dgb *DeviceGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*DeviceGroupBy) Float64sX

func (dgb *DeviceGroupBy) Float64sX(ctx context.Context) []float64

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

func (*DeviceGroupBy) Int

func (dgb *DeviceGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*DeviceGroupBy) IntX

func (dgb *DeviceGroupBy) IntX(ctx context.Context) int

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

func (*DeviceGroupBy) Ints

func (dgb *DeviceGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*DeviceGroupBy) IntsX

func (dgb *DeviceGroupBy) IntsX(ctx context.Context) []int

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

func (*DeviceGroupBy) Scan

func (dgb *DeviceGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*DeviceGroupBy) ScanX

func (dgb *DeviceGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*DeviceGroupBy) String

func (dgb *DeviceGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*DeviceGroupBy) StringX

func (dgb *DeviceGroupBy) StringX(ctx context.Context) string

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

func (*DeviceGroupBy) Strings

func (dgb *DeviceGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*DeviceGroupBy) StringsX

func (dgb *DeviceGroupBy) StringsX(ctx context.Context) []string

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

type DeviceMutation

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

DeviceMutation represents an operation that mutates the Device nodes in the graph.

func (*DeviceMutation) AddDeletedVlanIDs

func (m *DeviceMutation) AddDeletedVlanIDs(ids ...int)

AddDeletedVlanIDs adds the "deleted_vlans" edge to the DeletedVlanLog entity by ids.

func (*DeviceMutation) AddDeviceSSHPort

func (m *DeviceMutation) AddDeviceSSHPort(i int)

AddDeviceSSHPort adds i to the "device_ssh_port" field.

func (*DeviceMutation) AddField

func (m *DeviceMutation) 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 (*DeviceMutation) AddHaveIPAddressIDs added in v0.2.0

func (m *DeviceMutation) AddHaveIPAddressIDs(ids ...int)

AddHaveIPAddressIDs adds the "have_ip_addresses" edge to the IPAddress entity by ids.

func (*DeviceMutation) AddIPStaticRoutingIDs added in v0.2.0

func (m *DeviceMutation) AddIPStaticRoutingIDs(ids ...int)

AddIPStaticRoutingIDs adds the "ip_static_routing" edge to the IPStaticRoutingTable entity by ids.

func (*DeviceMutation) AddInTopologyIDs

func (m *DeviceMutation) AddInTopologyIDs(ids ...int)

AddInTopologyIDs adds the "in_topology" edge to the NetTopologyDeviceMap entity by ids.

func (*DeviceMutation) AddInterfaceIDs

func (m *DeviceMutation) AddInterfaceIDs(ids ...int)

AddInterfaceIDs adds the "interfaces" edge to the NetInterface entity by ids.

func (*DeviceMutation) AddPoInterfaceIDs added in v0.2.0

func (m *DeviceMutation) AddPoInterfaceIDs(ids ...int)

AddPoInterfaceIDs adds the "po_interfaces" edge to the PortChannelInterface entity by ids.

func (*DeviceMutation) AddStoreVlanIDs

func (m *DeviceMutation) AddStoreVlanIDs(ids ...int)

AddStoreVlanIDs adds the "store_vlans" edge to the Vlan entity by ids.

func (*DeviceMutation) AddedDeviceSSHPort

func (m *DeviceMutation) AddedDeviceSSHPort() (r int, exists bool)

AddedDeviceSSHPort returns the value that was added to the "device_ssh_port" field in this mutation.

func (*DeviceMutation) AddedEdges

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

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

func (*DeviceMutation) AddedField

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

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

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

func (*DeviceMutation) AddedIDs

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

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

func (*DeviceMutation) ClearDeletedVlans

func (m *DeviceMutation) ClearDeletedVlans()

ClearDeletedVlans clears the "deleted_vlans" edge to the DeletedVlanLog entity.

func (*DeviceMutation) ClearDevicePassword

func (m *DeviceMutation) ClearDevicePassword()

ClearDevicePassword clears the value of the "device_password" field.

func (*DeviceMutation) ClearDeviceSecret

func (m *DeviceMutation) ClearDeviceSecret()

ClearDeviceSecret clears the value of the "device_secret" field.

func (*DeviceMutation) ClearDeviceUsername

func (m *DeviceMutation) ClearDeviceUsername()

ClearDeviceUsername clears the value of the "device_username" field.

func (*DeviceMutation) ClearEdge

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

func (m *DeviceMutation) 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 (*DeviceMutation) ClearHaveIPAddresses added in v0.2.0

func (m *DeviceMutation) ClearHaveIPAddresses()

ClearHaveIPAddresses clears the "have_ip_addresses" edge to the IPAddress entity.

func (*DeviceMutation) ClearIPStaticRouting added in v0.2.0

func (m *DeviceMutation) ClearIPStaticRouting()

ClearIPStaticRouting clears the "ip_static_routing" edge to the IPStaticRoutingTable entity.

func (*DeviceMutation) ClearInPlatform

func (m *DeviceMutation) ClearInPlatform()

ClearInPlatform clears the "in_platform" edge to the DevicePlatform entity.

func (*DeviceMutation) ClearInTopology

func (m *DeviceMutation) ClearInTopology()

ClearInTopology clears the "in_topology" edge to the NetTopologyDeviceMap entity.

func (*DeviceMutation) ClearInType

func (m *DeviceMutation) ClearInType()

ClearInType clears the "in_type" edge to the DeviceType entity.

func (*DeviceMutation) ClearInterfaces

func (m *DeviceMutation) ClearInterfaces()

ClearInterfaces clears the "interfaces" edge to the NetInterface entity.

func (*DeviceMutation) ClearPoInterfaces added in v0.2.0

func (m *DeviceMutation) ClearPoInterfaces()

ClearPoInterfaces clears the "po_interfaces" edge to the PortChannelInterface entity.

func (*DeviceMutation) ClearStoreVlans

func (m *DeviceMutation) ClearStoreVlans()

ClearStoreVlans clears the "store_vlans" edge to the Vlan entity.

func (*DeviceMutation) ClearedEdges

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

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

func (*DeviceMutation) ClearedFields

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

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

func (DeviceMutation) Client

func (m DeviceMutation) 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 (*DeviceMutation) DeletedVlansCleared

func (m *DeviceMutation) DeletedVlansCleared() bool

DeletedVlansCleared reports if the "deleted_vlans" edge to the DeletedVlanLog entity was cleared.

func (*DeviceMutation) DeletedVlansIDs

func (m *DeviceMutation) DeletedVlansIDs() (ids []int)

DeletedVlansIDs returns the "deleted_vlans" edge IDs in the mutation.

func (*DeviceMutation) DeviceCommitConfig

func (m *DeviceMutation) DeviceCommitConfig() (r bool, exists bool)

DeviceCommitConfig returns the value of the "device_commit_config" field in the mutation.

func (*DeviceMutation) DeviceHostname

func (m *DeviceMutation) DeviceHostname() (r string, exists bool)

DeviceHostname returns the value of the "device_hostname" field in the mutation.

func (*DeviceMutation) DeviceName

func (m *DeviceMutation) DeviceName() (r string, exists bool)

DeviceName returns the value of the "device_name" field in the mutation.

func (*DeviceMutation) DevicePassword

func (m *DeviceMutation) DevicePassword() (r string, exists bool)

DevicePassword returns the value of the "device_password" field in the mutation.

func (*DeviceMutation) DevicePasswordCleared

func (m *DeviceMutation) DevicePasswordCleared() bool

DevicePasswordCleared returns if the "device_password" field was cleared in this mutation.

func (*DeviceMutation) DeviceSSHPort

func (m *DeviceMutation) DeviceSSHPort() (r int, exists bool)

DeviceSSHPort returns the value of the "device_ssh_port" field in the mutation.

func (*DeviceMutation) DeviceSecret

func (m *DeviceMutation) DeviceSecret() (r string, exists bool)

DeviceSecret returns the value of the "device_secret" field in the mutation.

func (*DeviceMutation) DeviceSecretCleared

func (m *DeviceMutation) DeviceSecretCleared() bool

DeviceSecretCleared returns if the "device_secret" field was cleared in this mutation.

func (*DeviceMutation) DeviceUsername

func (m *DeviceMutation) DeviceUsername() (r string, exists bool)

DeviceUsername returns the value of the "device_username" field in the mutation.

func (*DeviceMutation) DeviceUsernameCleared

func (m *DeviceMutation) DeviceUsernameCleared() bool

DeviceUsernameCleared returns if the "device_username" field was cleared in this mutation.

func (*DeviceMutation) EdgeCleared

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

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

func (*DeviceMutation) Field

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

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

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

func (*DeviceMutation) Fields

func (m *DeviceMutation) 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 (*DeviceMutation) HaveIPAddressesCleared added in v0.2.0

func (m *DeviceMutation) HaveIPAddressesCleared() bool

HaveIPAddressesCleared reports if the "have_ip_addresses" edge to the IPAddress entity was cleared.

func (*DeviceMutation) HaveIPAddressesIDs added in v0.2.0

func (m *DeviceMutation) HaveIPAddressesIDs() (ids []int)

HaveIPAddressesIDs returns the "have_ip_addresses" edge IDs in the mutation.

func (*DeviceMutation) ID

func (m *DeviceMutation) 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.

func (*DeviceMutation) IPStaticRoutingCleared added in v0.2.0

func (m *DeviceMutation) IPStaticRoutingCleared() bool

IPStaticRoutingCleared reports if the "ip_static_routing" edge to the IPStaticRoutingTable entity was cleared.

func (*DeviceMutation) IPStaticRoutingIDs added in v0.2.0

func (m *DeviceMutation) IPStaticRoutingIDs() (ids []int)

IPStaticRoutingIDs returns the "ip_static_routing" edge IDs in the mutation.

func (*DeviceMutation) InPlatformCleared

func (m *DeviceMutation) InPlatformCleared() bool

InPlatformCleared reports if the "in_platform" edge to the DevicePlatform entity was cleared.

func (*DeviceMutation) InPlatformID

func (m *DeviceMutation) InPlatformID() (id int, exists bool)

InPlatformID returns the "in_platform" edge ID in the mutation.

func (*DeviceMutation) InPlatformIDs

func (m *DeviceMutation) InPlatformIDs() (ids []int)

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

func (*DeviceMutation) InTopologyCleared

func (m *DeviceMutation) InTopologyCleared() bool

InTopologyCleared reports if the "in_topology" edge to the NetTopologyDeviceMap entity was cleared.

func (*DeviceMutation) InTopologyIDs

func (m *DeviceMutation) InTopologyIDs() (ids []int)

InTopologyIDs returns the "in_topology" edge IDs in the mutation.

func (*DeviceMutation) InTypeCleared

func (m *DeviceMutation) InTypeCleared() bool

InTypeCleared reports if the "in_type" edge to the DeviceType entity was cleared.

func (*DeviceMutation) InTypeID

func (m *DeviceMutation) InTypeID() (id int, exists bool)

InTypeID returns the "in_type" edge ID in the mutation.

func (*DeviceMutation) InTypeIDs

func (m *DeviceMutation) InTypeIDs() (ids []int)

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

func (*DeviceMutation) InterfacesCleared

func (m *DeviceMutation) InterfacesCleared() bool

InterfacesCleared reports if the "interfaces" edge to the NetInterface entity was cleared.

func (*DeviceMutation) InterfacesIDs

func (m *DeviceMutation) InterfacesIDs() (ids []int)

InterfacesIDs returns the "interfaces" edge IDs in the mutation.

func (*DeviceMutation) OldDeviceCommitConfig

func (m *DeviceMutation) OldDeviceCommitConfig(ctx context.Context) (v bool, err error)

OldDeviceCommitConfig returns the old "device_commit_config" field's value of the Device entity. If the Device 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 (*DeviceMutation) OldDeviceHostname

func (m *DeviceMutation) OldDeviceHostname(ctx context.Context) (v string, err error)

OldDeviceHostname returns the old "device_hostname" field's value of the Device entity. If the Device 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 (*DeviceMutation) OldDeviceName

func (m *DeviceMutation) OldDeviceName(ctx context.Context) (v string, err error)

OldDeviceName returns the old "device_name" field's value of the Device entity. If the Device 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 (*DeviceMutation) OldDevicePassword

func (m *DeviceMutation) OldDevicePassword(ctx context.Context) (v string, err error)

OldDevicePassword returns the old "device_password" field's value of the Device entity. If the Device 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 (*DeviceMutation) OldDeviceSSHPort

func (m *DeviceMutation) OldDeviceSSHPort(ctx context.Context) (v int, err error)

OldDeviceSSHPort returns the old "device_ssh_port" field's value of the Device entity. If the Device 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 (*DeviceMutation) OldDeviceSecret

func (m *DeviceMutation) OldDeviceSecret(ctx context.Context) (v string, err error)

OldDeviceSecret returns the old "device_secret" field's value of the Device entity. If the Device 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 (*DeviceMutation) OldDeviceUsername

func (m *DeviceMutation) OldDeviceUsername(ctx context.Context) (v string, err error)

OldDeviceUsername returns the old "device_username" field's value of the Device entity. If the Device 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 (*DeviceMutation) OldField

func (m *DeviceMutation) 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 (*DeviceMutation) Op

func (m *DeviceMutation) Op() Op

Op returns the operation name.

func (*DeviceMutation) PoInterfacesCleared added in v0.2.0

func (m *DeviceMutation) PoInterfacesCleared() bool

PoInterfacesCleared reports if the "po_interfaces" edge to the PortChannelInterface entity was cleared.

func (*DeviceMutation) PoInterfacesIDs added in v0.2.0

func (m *DeviceMutation) PoInterfacesIDs() (ids []int)

PoInterfacesIDs returns the "po_interfaces" edge IDs in the mutation.

func (*DeviceMutation) RemoveDeletedVlanIDs

func (m *DeviceMutation) RemoveDeletedVlanIDs(ids ...int)

RemoveDeletedVlanIDs removes the "deleted_vlans" edge to the DeletedVlanLog entity by IDs.

func (*DeviceMutation) RemoveHaveIPAddressIDs added in v0.2.0

func (m *DeviceMutation) RemoveHaveIPAddressIDs(ids ...int)

RemoveHaveIPAddressIDs removes the "have_ip_addresses" edge to the IPAddress entity by IDs.

func (*DeviceMutation) RemoveIPStaticRoutingIDs added in v0.2.0

func (m *DeviceMutation) RemoveIPStaticRoutingIDs(ids ...int)

RemoveIPStaticRoutingIDs removes the "ip_static_routing" edge to the IPStaticRoutingTable entity by IDs.

func (*DeviceMutation) RemoveInTopologyIDs

func (m *DeviceMutation) RemoveInTopologyIDs(ids ...int)

RemoveInTopologyIDs removes the "in_topology" edge to the NetTopologyDeviceMap entity by IDs.

func (*DeviceMutation) RemoveInterfaceIDs

func (m *DeviceMutation) RemoveInterfaceIDs(ids ...int)

RemoveInterfaceIDs removes the "interfaces" edge to the NetInterface entity by IDs.

func (*DeviceMutation) RemovePoInterfaceIDs added in v0.2.0

func (m *DeviceMutation) RemovePoInterfaceIDs(ids ...int)

RemovePoInterfaceIDs removes the "po_interfaces" edge to the PortChannelInterface entity by IDs.

func (*DeviceMutation) RemoveStoreVlanIDs

func (m *DeviceMutation) RemoveStoreVlanIDs(ids ...int)

RemoveStoreVlanIDs removes the "store_vlans" edge to the Vlan entity by IDs.

func (*DeviceMutation) RemovedDeletedVlansIDs

func (m *DeviceMutation) RemovedDeletedVlansIDs() (ids []int)

RemovedDeletedVlans returns the removed IDs of the "deleted_vlans" edge to the DeletedVlanLog entity.

func (*DeviceMutation) RemovedEdges

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

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

func (*DeviceMutation) RemovedHaveIPAddressesIDs added in v0.2.0

func (m *DeviceMutation) RemovedHaveIPAddressesIDs() (ids []int)

RemovedHaveIPAddresses returns the removed IDs of the "have_ip_addresses" edge to the IPAddress entity.

func (*DeviceMutation) RemovedIDs

func (m *DeviceMutation) 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 (*DeviceMutation) RemovedIPStaticRoutingIDs added in v0.2.0

func (m *DeviceMutation) RemovedIPStaticRoutingIDs() (ids []int)

RemovedIPStaticRouting returns the removed IDs of the "ip_static_routing" edge to the IPStaticRoutingTable entity.

func (*DeviceMutation) RemovedInTopologyIDs

func (m *DeviceMutation) RemovedInTopologyIDs() (ids []int)

RemovedInTopology returns the removed IDs of the "in_topology" edge to the NetTopologyDeviceMap entity.

func (*DeviceMutation) RemovedInterfacesIDs

func (m *DeviceMutation) RemovedInterfacesIDs() (ids []int)

RemovedInterfaces returns the removed IDs of the "interfaces" edge to the NetInterface entity.

func (*DeviceMutation) RemovedPoInterfacesIDs added in v0.2.0

func (m *DeviceMutation) RemovedPoInterfacesIDs() (ids []int)

RemovedPoInterfaces returns the removed IDs of the "po_interfaces" edge to the PortChannelInterface entity.

func (*DeviceMutation) RemovedStoreVlansIDs

func (m *DeviceMutation) RemovedStoreVlansIDs() (ids []int)

RemovedStoreVlans returns the removed IDs of the "store_vlans" edge to the Vlan entity.

func (*DeviceMutation) ResetDeletedVlans

func (m *DeviceMutation) ResetDeletedVlans()

ResetDeletedVlans resets all changes to the "deleted_vlans" edge.

func (*DeviceMutation) ResetDeviceCommitConfig

func (m *DeviceMutation) ResetDeviceCommitConfig()

ResetDeviceCommitConfig resets all changes to the "device_commit_config" field.

func (*DeviceMutation) ResetDeviceHostname

func (m *DeviceMutation) ResetDeviceHostname()

ResetDeviceHostname resets all changes to the "device_hostname" field.

func (*DeviceMutation) ResetDeviceName

func (m *DeviceMutation) ResetDeviceName()

ResetDeviceName resets all changes to the "device_name" field.

func (*DeviceMutation) ResetDevicePassword

func (m *DeviceMutation) ResetDevicePassword()

ResetDevicePassword resets all changes to the "device_password" field.

func (*DeviceMutation) ResetDeviceSSHPort

func (m *DeviceMutation) ResetDeviceSSHPort()

ResetDeviceSSHPort resets all changes to the "device_ssh_port" field.

func (*DeviceMutation) ResetDeviceSecret

func (m *DeviceMutation) ResetDeviceSecret()

ResetDeviceSecret resets all changes to the "device_secret" field.

func (*DeviceMutation) ResetDeviceUsername

func (m *DeviceMutation) ResetDeviceUsername()

ResetDeviceUsername resets all changes to the "device_username" field.

func (*DeviceMutation) ResetEdge

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

func (m *DeviceMutation) 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 (*DeviceMutation) ResetHaveIPAddresses added in v0.2.0

func (m *DeviceMutation) ResetHaveIPAddresses()

ResetHaveIPAddresses resets all changes to the "have_ip_addresses" edge.

func (*DeviceMutation) ResetIPStaticRouting added in v0.2.0

func (m *DeviceMutation) ResetIPStaticRouting()

ResetIPStaticRouting resets all changes to the "ip_static_routing" edge.

func (*DeviceMutation) ResetInPlatform

func (m *DeviceMutation) ResetInPlatform()

ResetInPlatform resets all changes to the "in_platform" edge.

func (*DeviceMutation) ResetInTopology

func (m *DeviceMutation) ResetInTopology()

ResetInTopology resets all changes to the "in_topology" edge.

func (*DeviceMutation) ResetInType

func (m *DeviceMutation) ResetInType()

ResetInType resets all changes to the "in_type" edge.

func (*DeviceMutation) ResetInterfaces

func (m *DeviceMutation) ResetInterfaces()

ResetInterfaces resets all changes to the "interfaces" edge.

func (*DeviceMutation) ResetPoInterfaces added in v0.2.0

func (m *DeviceMutation) ResetPoInterfaces()

ResetPoInterfaces resets all changes to the "po_interfaces" edge.

func (*DeviceMutation) ResetStoreVlans

func (m *DeviceMutation) ResetStoreVlans()

ResetStoreVlans resets all changes to the "store_vlans" edge.

func (*DeviceMutation) SetDeviceCommitConfig

func (m *DeviceMutation) SetDeviceCommitConfig(b bool)

SetDeviceCommitConfig sets the "device_commit_config" field.

func (*DeviceMutation) SetDeviceHostname

func (m *DeviceMutation) SetDeviceHostname(s string)

SetDeviceHostname sets the "device_hostname" field.

func (*DeviceMutation) SetDeviceName

func (m *DeviceMutation) SetDeviceName(s string)

SetDeviceName sets the "device_name" field.

func (*DeviceMutation) SetDevicePassword

func (m *DeviceMutation) SetDevicePassword(s string)

SetDevicePassword sets the "device_password" field.

func (*DeviceMutation) SetDeviceSSHPort

func (m *DeviceMutation) SetDeviceSSHPort(i int)

SetDeviceSSHPort sets the "device_ssh_port" field.

func (*DeviceMutation) SetDeviceSecret

func (m *DeviceMutation) SetDeviceSecret(s string)

SetDeviceSecret sets the "device_secret" field.

func (*DeviceMutation) SetDeviceUsername

func (m *DeviceMutation) SetDeviceUsername(s string)

SetDeviceUsername sets the "device_username" field.

func (*DeviceMutation) SetField

func (m *DeviceMutation) 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 (*DeviceMutation) SetInPlatformID

func (m *DeviceMutation) SetInPlatformID(id int)

SetInPlatformID sets the "in_platform" edge to the DevicePlatform entity by id.

func (*DeviceMutation) SetInTypeID

func (m *DeviceMutation) SetInTypeID(id int)

SetInTypeID sets the "in_type" edge to the DeviceType entity by id.

func (*DeviceMutation) StoreVlansCleared

func (m *DeviceMutation) StoreVlansCleared() bool

StoreVlansCleared reports if the "store_vlans" edge to the Vlan entity was cleared.

func (*DeviceMutation) StoreVlansIDs

func (m *DeviceMutation) StoreVlansIDs() (ids []int)

StoreVlansIDs returns the "store_vlans" edge IDs in the mutation.

func (DeviceMutation) Tx

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

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

func (*DeviceMutation) Type

func (m *DeviceMutation) Type() string

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

type DevicePlatform

type DevicePlatform struct {

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

DevicePlatform is the model entity for the DevicePlatform schema.

func (*DevicePlatform) QueryPlatforms

func (dp *DevicePlatform) QueryPlatforms() *DeviceQuery

QueryPlatforms queries the "platforms" edge of the DevicePlatform entity.

func (*DevicePlatform) String

func (dp *DevicePlatform) String() string

String implements the fmt.Stringer.

func (*DevicePlatform) Unwrap

func (dp *DevicePlatform) Unwrap() *DevicePlatform

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

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

type DevicePlatformClient

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

DevicePlatformClient is a client for the DevicePlatform schema.

func NewDevicePlatformClient

func NewDevicePlatformClient(c config) *DevicePlatformClient

NewDevicePlatformClient returns a client for the DevicePlatform from the given config.

func (*DevicePlatformClient) Create

Create returns a create builder for DevicePlatform.

func (*DevicePlatformClient) CreateBulk

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

func (*DevicePlatformClient) Delete

Delete returns a delete builder for DevicePlatform.

func (*DevicePlatformClient) DeleteOne

DeleteOne returns a delete builder for the given entity.

func (*DevicePlatformClient) DeleteOneID

func (c *DevicePlatformClient) DeleteOneID(id int) *DevicePlatformDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*DevicePlatformClient) Get

Get returns a DevicePlatform entity by its id.

func (*DevicePlatformClient) GetX

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

func (*DevicePlatformClient) Hooks

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

Hooks returns the client hooks.

func (*DevicePlatformClient) Query

Query returns a query builder for DevicePlatform.

func (*DevicePlatformClient) QueryPlatforms

func (c *DevicePlatformClient) QueryPlatforms(dp *DevicePlatform) *DeviceQuery

QueryPlatforms queries the platforms edge of a DevicePlatform.

func (*DevicePlatformClient) Update

Update returns an update builder for DevicePlatform.

func (*DevicePlatformClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*DevicePlatformClient) UpdateOneID

func (c *DevicePlatformClient) UpdateOneID(id int) *DevicePlatformUpdateOne

UpdateOneID returns an update builder for the given id.

func (*DevicePlatformClient) Use

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

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

type DevicePlatformCreate

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

DevicePlatformCreate is the builder for creating a DevicePlatform entity.

func (*DevicePlatformCreate) AddPlatformIDs

func (dpc *DevicePlatformCreate) AddPlatformIDs(ids ...int) *DevicePlatformCreate

AddPlatformIDs adds the "platforms" edge to the Device entity by IDs.

func (*DevicePlatformCreate) AddPlatforms

func (dpc *DevicePlatformCreate) AddPlatforms(d ...*Device) *DevicePlatformCreate

AddPlatforms adds the "platforms" edges to the Device entity.

func (*DevicePlatformCreate) Mutation

Mutation returns the DevicePlatformMutation object of the builder.

func (*DevicePlatformCreate) Save

Save creates the DevicePlatform in the database.

func (*DevicePlatformCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*DevicePlatformCreate) SetDevicePlatformName

func (dpc *DevicePlatformCreate) SetDevicePlatformName(s string) *DevicePlatformCreate

SetDevicePlatformName sets the "device_platform_name" field.

type DevicePlatformCreateBulk

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

DevicePlatformCreateBulk is the builder for creating many DevicePlatform entities in bulk.

func (*DevicePlatformCreateBulk) Save

Save creates the DevicePlatform entities in the database.

func (*DevicePlatformCreateBulk) SaveX

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

type DevicePlatformDelete

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

DevicePlatformDelete is the builder for deleting a DevicePlatform entity.

func (*DevicePlatformDelete) Exec

func (dpd *DevicePlatformDelete) Exec(ctx context.Context) (int, error)

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

func (*DevicePlatformDelete) ExecX

func (dpd *DevicePlatformDelete) ExecX(ctx context.Context) int

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

func (*DevicePlatformDelete) Where

Where adds a new predicate to the DevicePlatformDelete builder.

type DevicePlatformDeleteOne

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

DevicePlatformDeleteOne is the builder for deleting a single DevicePlatform entity.

func (*DevicePlatformDeleteOne) Exec

func (dpdo *DevicePlatformDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*DevicePlatformDeleteOne) ExecX

func (dpdo *DevicePlatformDeleteOne) ExecX(ctx context.Context)

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

type DevicePlatformEdges

type DevicePlatformEdges struct {
	// Platforms holds the value of the platforms edge.
	Platforms []*Device `json:"platforms,omitempty"`
	// contains filtered or unexported fields
}

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

func (DevicePlatformEdges) PlatformsOrErr

func (e DevicePlatformEdges) PlatformsOrErr() ([]*Device, error)

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

type DevicePlatformGroupBy

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

DevicePlatformGroupBy is the group-by builder for DevicePlatform entities.

func (*DevicePlatformGroupBy) Aggregate

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

func (*DevicePlatformGroupBy) Bool

func (dpgb *DevicePlatformGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*DevicePlatformGroupBy) BoolX

func (dpgb *DevicePlatformGroupBy) BoolX(ctx context.Context) bool

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

func (*DevicePlatformGroupBy) Bools

func (dpgb *DevicePlatformGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*DevicePlatformGroupBy) BoolsX

func (dpgb *DevicePlatformGroupBy) BoolsX(ctx context.Context) []bool

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

func (*DevicePlatformGroupBy) Float64

func (dpgb *DevicePlatformGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*DevicePlatformGroupBy) Float64X

func (dpgb *DevicePlatformGroupBy) Float64X(ctx context.Context) float64

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

func (*DevicePlatformGroupBy) Float64s

func (dpgb *DevicePlatformGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*DevicePlatformGroupBy) Float64sX

func (dpgb *DevicePlatformGroupBy) Float64sX(ctx context.Context) []float64

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

func (*DevicePlatformGroupBy) Int

func (dpgb *DevicePlatformGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*DevicePlatformGroupBy) IntX

func (dpgb *DevicePlatformGroupBy) IntX(ctx context.Context) int

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

func (*DevicePlatformGroupBy) Ints

func (dpgb *DevicePlatformGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*DevicePlatformGroupBy) IntsX

func (dpgb *DevicePlatformGroupBy) IntsX(ctx context.Context) []int

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

func (*DevicePlatformGroupBy) Scan

func (dpgb *DevicePlatformGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*DevicePlatformGroupBy) ScanX

func (dpgb *DevicePlatformGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*DevicePlatformGroupBy) String

func (dpgb *DevicePlatformGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*DevicePlatformGroupBy) StringX

func (dpgb *DevicePlatformGroupBy) StringX(ctx context.Context) string

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

func (*DevicePlatformGroupBy) Strings

func (dpgb *DevicePlatformGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*DevicePlatformGroupBy) StringsX

func (dpgb *DevicePlatformGroupBy) StringsX(ctx context.Context) []string

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

type DevicePlatformMutation

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

DevicePlatformMutation represents an operation that mutates the DevicePlatform nodes in the graph.

func (*DevicePlatformMutation) AddField

func (m *DevicePlatformMutation) 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 (*DevicePlatformMutation) AddPlatformIDs

func (m *DevicePlatformMutation) AddPlatformIDs(ids ...int)

AddPlatformIDs adds the "platforms" edge to the Device entity by ids.

func (*DevicePlatformMutation) AddedEdges

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

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

func (*DevicePlatformMutation) AddedField

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

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

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

func (*DevicePlatformMutation) AddedIDs

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

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

func (*DevicePlatformMutation) ClearEdge

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

func (m *DevicePlatformMutation) 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 (*DevicePlatformMutation) ClearPlatforms

func (m *DevicePlatformMutation) ClearPlatforms()

ClearPlatforms clears the "platforms" edge to the Device entity.

func (*DevicePlatformMutation) ClearedEdges

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

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

func (*DevicePlatformMutation) ClearedFields

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

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

func (DevicePlatformMutation) Client

func (m DevicePlatformMutation) 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 (*DevicePlatformMutation) DevicePlatformName

func (m *DevicePlatformMutation) DevicePlatformName() (r string, exists bool)

DevicePlatformName returns the value of the "device_platform_name" field in the mutation.

func (*DevicePlatformMutation) EdgeCleared

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

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

func (*DevicePlatformMutation) Field

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

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

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

func (*DevicePlatformMutation) Fields

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

func (m *DevicePlatformMutation) 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.

func (*DevicePlatformMutation) OldDevicePlatformName

func (m *DevicePlatformMutation) OldDevicePlatformName(ctx context.Context) (v string, err error)

OldDevicePlatformName returns the old "device_platform_name" field's value of the DevicePlatform entity. If the DevicePlatform 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 (*DevicePlatformMutation) OldField

func (m *DevicePlatformMutation) 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 (*DevicePlatformMutation) Op

func (m *DevicePlatformMutation) Op() Op

Op returns the operation name.

func (*DevicePlatformMutation) PlatformsCleared

func (m *DevicePlatformMutation) PlatformsCleared() bool

PlatformsCleared reports if the "platforms" edge to the Device entity was cleared.

func (*DevicePlatformMutation) PlatformsIDs

func (m *DevicePlatformMutation) PlatformsIDs() (ids []int)

PlatformsIDs returns the "platforms" edge IDs in the mutation.

func (*DevicePlatformMutation) RemovePlatformIDs

func (m *DevicePlatformMutation) RemovePlatformIDs(ids ...int)

RemovePlatformIDs removes the "platforms" edge to the Device entity by IDs.

func (*DevicePlatformMutation) RemovedEdges

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

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

func (*DevicePlatformMutation) RemovedIDs

func (m *DevicePlatformMutation) 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 (*DevicePlatformMutation) RemovedPlatformsIDs

func (m *DevicePlatformMutation) RemovedPlatformsIDs() (ids []int)

RemovedPlatforms returns the removed IDs of the "platforms" edge to the Device entity.

func (*DevicePlatformMutation) ResetDevicePlatformName

func (m *DevicePlatformMutation) ResetDevicePlatformName()

ResetDevicePlatformName resets all changes to the "device_platform_name" field.

func (*DevicePlatformMutation) ResetEdge

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

func (m *DevicePlatformMutation) 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 (*DevicePlatformMutation) ResetPlatforms

func (m *DevicePlatformMutation) ResetPlatforms()

ResetPlatforms resets all changes to the "platforms" edge.

func (*DevicePlatformMutation) SetDevicePlatformName

func (m *DevicePlatformMutation) SetDevicePlatformName(s string)

SetDevicePlatformName sets the "device_platform_name" field.

func (*DevicePlatformMutation) SetField

func (m *DevicePlatformMutation) 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 (DevicePlatformMutation) Tx

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

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

func (*DevicePlatformMutation) Type

func (m *DevicePlatformMutation) Type() string

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

type DevicePlatformQuery

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

DevicePlatformQuery is the builder for querying DevicePlatform entities.

func (*DevicePlatformQuery) All

All executes the query and returns a list of DevicePlatforms.

func (*DevicePlatformQuery) AllX

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

func (*DevicePlatformQuery) Clone

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

func (*DevicePlatformQuery) Count

func (dpq *DevicePlatformQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*DevicePlatformQuery) CountX

func (dpq *DevicePlatformQuery) CountX(ctx context.Context) int

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

func (*DevicePlatformQuery) Exist

func (dpq *DevicePlatformQuery) Exist(ctx context.Context) (bool, error)

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

func (*DevicePlatformQuery) ExistX

func (dpq *DevicePlatformQuery) ExistX(ctx context.Context) bool

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

func (*DevicePlatformQuery) First

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

func (*DevicePlatformQuery) FirstID

func (dpq *DevicePlatformQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*DevicePlatformQuery) FirstIDX

func (dpq *DevicePlatformQuery) FirstIDX(ctx context.Context) int

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

func (*DevicePlatformQuery) FirstX

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

func (*DevicePlatformQuery) GroupBy

func (dpq *DevicePlatformQuery) GroupBy(field string, fields ...string) *DevicePlatformGroupBy

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

client.DevicePlatform.Query().
	GroupBy(deviceplatform.FieldDevicePlatformName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*DevicePlatformQuery) IDs

func (dpq *DevicePlatformQuery) IDs(ctx context.Context) ([]int, error)

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

func (*DevicePlatformQuery) IDsX

func (dpq *DevicePlatformQuery) IDsX(ctx context.Context) []int

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

func (*DevicePlatformQuery) Limit

func (dpq *DevicePlatformQuery) Limit(limit int) *DevicePlatformQuery

Limit adds a limit step to the query.

func (*DevicePlatformQuery) Offset

func (dpq *DevicePlatformQuery) Offset(offset int) *DevicePlatformQuery

Offset adds an offset step to the query.

func (*DevicePlatformQuery) Only

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

func (*DevicePlatformQuery) OnlyID

func (dpq *DevicePlatformQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*DevicePlatformQuery) OnlyIDX

func (dpq *DevicePlatformQuery) OnlyIDX(ctx context.Context) int

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

func (*DevicePlatformQuery) OnlyX

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

func (*DevicePlatformQuery) Order

Order adds an order step to the query.

func (*DevicePlatformQuery) QueryPlatforms

func (dpq *DevicePlatformQuery) QueryPlatforms() *DeviceQuery

QueryPlatforms chains the current query on the "platforms" edge.

func (*DevicePlatformQuery) Select

func (dpq *DevicePlatformQuery) Select(field string, fields ...string) *DevicePlatformSelect

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

client.DevicePlatform.Query().
	Select(deviceplatform.FieldDevicePlatformName).
	Scan(ctx, &v)

func (*DevicePlatformQuery) Unique

func (dpq *DevicePlatformQuery) Unique(unique bool) *DevicePlatformQuery

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

Where adds a new predicate for the DevicePlatformQuery builder.

func (*DevicePlatformQuery) WithPlatforms

func (dpq *DevicePlatformQuery) WithPlatforms(opts ...func(*DeviceQuery)) *DevicePlatformQuery

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

type DevicePlatformSelect

type DevicePlatformSelect struct {
	*DevicePlatformQuery
	// contains filtered or unexported fields
}

DevicePlatformSelect is the builder for selecting fields of DevicePlatform entities.

func (*DevicePlatformSelect) Bool

func (dps *DevicePlatformSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*DevicePlatformSelect) BoolX

func (dps *DevicePlatformSelect) BoolX(ctx context.Context) bool

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

func (*DevicePlatformSelect) Bools

func (dps *DevicePlatformSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*DevicePlatformSelect) BoolsX

func (dps *DevicePlatformSelect) BoolsX(ctx context.Context) []bool

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

func (*DevicePlatformSelect) Float64

func (dps *DevicePlatformSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*DevicePlatformSelect) Float64X

func (dps *DevicePlatformSelect) Float64X(ctx context.Context) float64

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

func (*DevicePlatformSelect) Float64s

func (dps *DevicePlatformSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*DevicePlatformSelect) Float64sX

func (dps *DevicePlatformSelect) Float64sX(ctx context.Context) []float64

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

func (*DevicePlatformSelect) Int

func (dps *DevicePlatformSelect) Int(ctx context.Context) (_ int, err error)

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

func (*DevicePlatformSelect) IntX

func (dps *DevicePlatformSelect) IntX(ctx context.Context) int

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

func (*DevicePlatformSelect) Ints

func (dps *DevicePlatformSelect) Ints(ctx context.Context) ([]int, error)

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

func (*DevicePlatformSelect) IntsX

func (dps *DevicePlatformSelect) IntsX(ctx context.Context) []int

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

func (*DevicePlatformSelect) Scan

func (dps *DevicePlatformSelect) Scan(ctx context.Context, v interface{}) error

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

func (*DevicePlatformSelect) ScanX

func (dps *DevicePlatformSelect) ScanX(ctx context.Context, v interface{})

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

func (*DevicePlatformSelect) String

func (dps *DevicePlatformSelect) String(ctx context.Context) (_ string, err error)

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

func (*DevicePlatformSelect) StringX

func (dps *DevicePlatformSelect) StringX(ctx context.Context) string

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

func (*DevicePlatformSelect) Strings

func (dps *DevicePlatformSelect) Strings(ctx context.Context) ([]string, error)

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

func (*DevicePlatformSelect) StringsX

func (dps *DevicePlatformSelect) StringsX(ctx context.Context) []string

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

type DevicePlatformUpdate

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

DevicePlatformUpdate is the builder for updating DevicePlatform entities.

func (*DevicePlatformUpdate) AddPlatformIDs

func (dpu *DevicePlatformUpdate) AddPlatformIDs(ids ...int) *DevicePlatformUpdate

AddPlatformIDs adds the "platforms" edge to the Device entity by IDs.

func (*DevicePlatformUpdate) AddPlatforms

func (dpu *DevicePlatformUpdate) AddPlatforms(d ...*Device) *DevicePlatformUpdate

AddPlatforms adds the "platforms" edges to the Device entity.

func (*DevicePlatformUpdate) ClearPlatforms

func (dpu *DevicePlatformUpdate) ClearPlatforms() *DevicePlatformUpdate

ClearPlatforms clears all "platforms" edges to the Device entity.

func (*DevicePlatformUpdate) Exec

func (dpu *DevicePlatformUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*DevicePlatformUpdate) ExecX

func (dpu *DevicePlatformUpdate) ExecX(ctx context.Context)

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

func (*DevicePlatformUpdate) Mutation

Mutation returns the DevicePlatformMutation object of the builder.

func (*DevicePlatformUpdate) RemovePlatformIDs

func (dpu *DevicePlatformUpdate) RemovePlatformIDs(ids ...int) *DevicePlatformUpdate

RemovePlatformIDs removes the "platforms" edge to Device entities by IDs.

func (*DevicePlatformUpdate) RemovePlatforms

func (dpu *DevicePlatformUpdate) RemovePlatforms(d ...*Device) *DevicePlatformUpdate

RemovePlatforms removes "platforms" edges to Device entities.

func (*DevicePlatformUpdate) Save

func (dpu *DevicePlatformUpdate) Save(ctx context.Context) (int, error)

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

func (*DevicePlatformUpdate) SaveX

func (dpu *DevicePlatformUpdate) SaveX(ctx context.Context) int

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

func (*DevicePlatformUpdate) SetDevicePlatformName

func (dpu *DevicePlatformUpdate) SetDevicePlatformName(s string) *DevicePlatformUpdate

SetDevicePlatformName sets the "device_platform_name" field.

func (*DevicePlatformUpdate) Where

Where adds a new predicate for the DevicePlatformUpdate builder.

type DevicePlatformUpdateOne

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

DevicePlatformUpdateOne is the builder for updating a single DevicePlatform entity.

func (*DevicePlatformUpdateOne) AddPlatformIDs

func (dpuo *DevicePlatformUpdateOne) AddPlatformIDs(ids ...int) *DevicePlatformUpdateOne

AddPlatformIDs adds the "platforms" edge to the Device entity by IDs.

func (*DevicePlatformUpdateOne) AddPlatforms

func (dpuo *DevicePlatformUpdateOne) AddPlatforms(d ...*Device) *DevicePlatformUpdateOne

AddPlatforms adds the "platforms" edges to the Device entity.

func (*DevicePlatformUpdateOne) ClearPlatforms

func (dpuo *DevicePlatformUpdateOne) ClearPlatforms() *DevicePlatformUpdateOne

ClearPlatforms clears all "platforms" edges to the Device entity.

func (*DevicePlatformUpdateOne) Exec

func (dpuo *DevicePlatformUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*DevicePlatformUpdateOne) ExecX

func (dpuo *DevicePlatformUpdateOne) ExecX(ctx context.Context)

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

func (*DevicePlatformUpdateOne) Mutation

Mutation returns the DevicePlatformMutation object of the builder.

func (*DevicePlatformUpdateOne) RemovePlatformIDs

func (dpuo *DevicePlatformUpdateOne) RemovePlatformIDs(ids ...int) *DevicePlatformUpdateOne

RemovePlatformIDs removes the "platforms" edge to Device entities by IDs.

func (*DevicePlatformUpdateOne) RemovePlatforms

func (dpuo *DevicePlatformUpdateOne) RemovePlatforms(d ...*Device) *DevicePlatformUpdateOne

RemovePlatforms removes "platforms" edges to Device entities.

func (*DevicePlatformUpdateOne) Save

Save executes the query and returns the updated DevicePlatform entity.

func (*DevicePlatformUpdateOne) SaveX

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

func (*DevicePlatformUpdateOne) Select

func (dpuo *DevicePlatformUpdateOne) Select(field string, fields ...string) *DevicePlatformUpdateOne

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

func (*DevicePlatformUpdateOne) SetDevicePlatformName

func (dpuo *DevicePlatformUpdateOne) SetDevicePlatformName(s string) *DevicePlatformUpdateOne

SetDevicePlatformName sets the "device_platform_name" field.

type DevicePlatforms

type DevicePlatforms []*DevicePlatform

DevicePlatforms is a parsable slice of DevicePlatform.

type DeviceQuery

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

DeviceQuery is the builder for querying Device entities.

func (*DeviceQuery) All

func (dq *DeviceQuery) All(ctx context.Context) ([]*Device, error)

All executes the query and returns a list of Devices.

func (*DeviceQuery) AllX

func (dq *DeviceQuery) AllX(ctx context.Context) []*Device

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

func (*DeviceQuery) Clone

func (dq *DeviceQuery) Clone() *DeviceQuery

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

func (*DeviceQuery) Count

func (dq *DeviceQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*DeviceQuery) CountX

func (dq *DeviceQuery) CountX(ctx context.Context) int

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

func (*DeviceQuery) Exist

func (dq *DeviceQuery) Exist(ctx context.Context) (bool, error)

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

func (*DeviceQuery) ExistX

func (dq *DeviceQuery) ExistX(ctx context.Context) bool

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

func (*DeviceQuery) First

func (dq *DeviceQuery) First(ctx context.Context) (*Device, error)

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

func (*DeviceQuery) FirstID

func (dq *DeviceQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*DeviceQuery) FirstIDX

func (dq *DeviceQuery) FirstIDX(ctx context.Context) int

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

func (*DeviceQuery) FirstX

func (dq *DeviceQuery) FirstX(ctx context.Context) *Device

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

func (*DeviceQuery) GroupBy

func (dq *DeviceQuery) GroupBy(field string, fields ...string) *DeviceGroupBy

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

client.Device.Query().
	GroupBy(device.FieldDeviceName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*DeviceQuery) IDs

func (dq *DeviceQuery) IDs(ctx context.Context) ([]int, error)

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

func (*DeviceQuery) IDsX

func (dq *DeviceQuery) IDsX(ctx context.Context) []int

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

func (*DeviceQuery) Limit

func (dq *DeviceQuery) Limit(limit int) *DeviceQuery

Limit adds a limit step to the query.

func (*DeviceQuery) Offset

func (dq *DeviceQuery) Offset(offset int) *DeviceQuery

Offset adds an offset step to the query.

func (*DeviceQuery) Only

func (dq *DeviceQuery) Only(ctx context.Context) (*Device, error)

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

func (*DeviceQuery) OnlyID

func (dq *DeviceQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*DeviceQuery) OnlyIDX

func (dq *DeviceQuery) OnlyIDX(ctx context.Context) int

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

func (*DeviceQuery) OnlyX

func (dq *DeviceQuery) OnlyX(ctx context.Context) *Device

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

func (*DeviceQuery) Order

func (dq *DeviceQuery) Order(o ...OrderFunc) *DeviceQuery

Order adds an order step to the query.

func (*DeviceQuery) QueryDeletedVlans

func (dq *DeviceQuery) QueryDeletedVlans() *DeletedVlanLogQuery

QueryDeletedVlans chains the current query on the "deleted_vlans" edge.

func (*DeviceQuery) QueryHaveIPAddresses added in v0.2.0

func (dq *DeviceQuery) QueryHaveIPAddresses() *IPAddressQuery

QueryHaveIPAddresses chains the current query on the "have_ip_addresses" edge.

func (*DeviceQuery) QueryIPStaticRouting added in v0.2.0

func (dq *DeviceQuery) QueryIPStaticRouting() *IPStaticRoutingTableQuery

QueryIPStaticRouting chains the current query on the "ip_static_routing" edge.

func (*DeviceQuery) QueryInPlatform

func (dq *DeviceQuery) QueryInPlatform() *DevicePlatformQuery

QueryInPlatform chains the current query on the "in_platform" edge.

func (*DeviceQuery) QueryInTopology

func (dq *DeviceQuery) QueryInTopology() *NetTopologyDeviceMapQuery

QueryInTopology chains the current query on the "in_topology" edge.

func (*DeviceQuery) QueryInType

func (dq *DeviceQuery) QueryInType() *DeviceTypeQuery

QueryInType chains the current query on the "in_type" edge.

func (*DeviceQuery) QueryInterfaces

func (dq *DeviceQuery) QueryInterfaces() *NetInterfaceQuery

QueryInterfaces chains the current query on the "interfaces" edge.

func (*DeviceQuery) QueryPoInterfaces added in v0.2.0

func (dq *DeviceQuery) QueryPoInterfaces() *PortChannelInterfaceQuery

QueryPoInterfaces chains the current query on the "po_interfaces" edge.

func (*DeviceQuery) QueryStoreVlans

func (dq *DeviceQuery) QueryStoreVlans() *VlanQuery

QueryStoreVlans chains the current query on the "store_vlans" edge.

func (*DeviceQuery) Select

func (dq *DeviceQuery) Select(field string, fields ...string) *DeviceSelect

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

client.Device.Query().
	Select(device.FieldDeviceName).
	Scan(ctx, &v)

func (*DeviceQuery) Unique

func (dq *DeviceQuery) Unique(unique bool) *DeviceQuery

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

func (dq *DeviceQuery) Where(ps ...predicate.Device) *DeviceQuery

Where adds a new predicate for the DeviceQuery builder.

func (*DeviceQuery) WithDeletedVlans

func (dq *DeviceQuery) WithDeletedVlans(opts ...func(*DeletedVlanLogQuery)) *DeviceQuery

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

func (*DeviceQuery) WithHaveIPAddresses added in v0.2.0

func (dq *DeviceQuery) WithHaveIPAddresses(opts ...func(*IPAddressQuery)) *DeviceQuery

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

func (*DeviceQuery) WithIPStaticRouting added in v0.2.0

func (dq *DeviceQuery) WithIPStaticRouting(opts ...func(*IPStaticRoutingTableQuery)) *DeviceQuery

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

func (*DeviceQuery) WithInPlatform

func (dq *DeviceQuery) WithInPlatform(opts ...func(*DevicePlatformQuery)) *DeviceQuery

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

func (*DeviceQuery) WithInTopology

func (dq *DeviceQuery) WithInTopology(opts ...func(*NetTopologyDeviceMapQuery)) *DeviceQuery

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

func (*DeviceQuery) WithInType

func (dq *DeviceQuery) WithInType(opts ...func(*DeviceTypeQuery)) *DeviceQuery

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

func (*DeviceQuery) WithInterfaces

func (dq *DeviceQuery) WithInterfaces(opts ...func(*NetInterfaceQuery)) *DeviceQuery

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

func (*DeviceQuery) WithPoInterfaces added in v0.2.0

func (dq *DeviceQuery) WithPoInterfaces(opts ...func(*PortChannelInterfaceQuery)) *DeviceQuery

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

func (*DeviceQuery) WithStoreVlans

func (dq *DeviceQuery) WithStoreVlans(opts ...func(*VlanQuery)) *DeviceQuery

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

type DeviceSelect

type DeviceSelect struct {
	*DeviceQuery
	// contains filtered or unexported fields
}

DeviceSelect is the builder for selecting fields of Device entities.

func (*DeviceSelect) Bool

func (ds *DeviceSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*DeviceSelect) BoolX

func (ds *DeviceSelect) BoolX(ctx context.Context) bool

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

func (*DeviceSelect) Bools

func (ds *DeviceSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*DeviceSelect) BoolsX

func (ds *DeviceSelect) BoolsX(ctx context.Context) []bool

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

func (*DeviceSelect) Float64

func (ds *DeviceSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*DeviceSelect) Float64X

func (ds *DeviceSelect) Float64X(ctx context.Context) float64

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

func (*DeviceSelect) Float64s

func (ds *DeviceSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*DeviceSelect) Float64sX

func (ds *DeviceSelect) Float64sX(ctx context.Context) []float64

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

func (*DeviceSelect) Int

func (ds *DeviceSelect) Int(ctx context.Context) (_ int, err error)

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

func (*DeviceSelect) IntX

func (ds *DeviceSelect) IntX(ctx context.Context) int

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

func (*DeviceSelect) Ints

func (ds *DeviceSelect) Ints(ctx context.Context) ([]int, error)

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

func (*DeviceSelect) IntsX

func (ds *DeviceSelect) IntsX(ctx context.Context) []int

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

func (*DeviceSelect) Scan

func (ds *DeviceSelect) Scan(ctx context.Context, v interface{}) error

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

func (*DeviceSelect) ScanX

func (ds *DeviceSelect) ScanX(ctx context.Context, v interface{})

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

func (*DeviceSelect) String

func (ds *DeviceSelect) String(ctx context.Context) (_ string, err error)

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

func (*DeviceSelect) StringX

func (ds *DeviceSelect) StringX(ctx context.Context) string

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

func (*DeviceSelect) Strings

func (ds *DeviceSelect) Strings(ctx context.Context) ([]string, error)

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

func (*DeviceSelect) StringsX

func (ds *DeviceSelect) StringsX(ctx context.Context) []string

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

type DeviceType

type DeviceType struct {

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

DeviceType is the model entity for the DeviceType schema.

func (*DeviceType) QueryTypes

func (dt *DeviceType) QueryTypes() *DeviceQuery

QueryTypes queries the "types" edge of the DeviceType entity.

func (*DeviceType) String

func (dt *DeviceType) String() string

String implements the fmt.Stringer.

func (*DeviceType) Unwrap

func (dt *DeviceType) Unwrap() *DeviceType

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

func (dt *DeviceType) Update() *DeviceTypeUpdateOne

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

type DeviceTypeClient

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

DeviceTypeClient is a client for the DeviceType schema.

func NewDeviceTypeClient

func NewDeviceTypeClient(c config) *DeviceTypeClient

NewDeviceTypeClient returns a client for the DeviceType from the given config.

func (*DeviceTypeClient) Create

func (c *DeviceTypeClient) Create() *DeviceTypeCreate

Create returns a create builder for DeviceType.

func (*DeviceTypeClient) CreateBulk

func (c *DeviceTypeClient) CreateBulk(builders ...*DeviceTypeCreate) *DeviceTypeCreateBulk

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

func (*DeviceTypeClient) Delete

func (c *DeviceTypeClient) Delete() *DeviceTypeDelete

Delete returns a delete builder for DeviceType.

func (*DeviceTypeClient) DeleteOne

func (c *DeviceTypeClient) DeleteOne(dt *DeviceType) *DeviceTypeDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*DeviceTypeClient) DeleteOneID

func (c *DeviceTypeClient) DeleteOneID(id int) *DeviceTypeDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*DeviceTypeClient) Get

func (c *DeviceTypeClient) Get(ctx context.Context, id int) (*DeviceType, error)

Get returns a DeviceType entity by its id.

func (*DeviceTypeClient) GetX

func (c *DeviceTypeClient) GetX(ctx context.Context, id int) *DeviceType

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

func (*DeviceTypeClient) Hooks

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

Hooks returns the client hooks.

func (*DeviceTypeClient) Query

func (c *DeviceTypeClient) Query() *DeviceTypeQuery

Query returns a query builder for DeviceType.

func (*DeviceTypeClient) QueryTypes

func (c *DeviceTypeClient) QueryTypes(dt *DeviceType) *DeviceQuery

QueryTypes queries the types edge of a DeviceType.

func (*DeviceTypeClient) Update

func (c *DeviceTypeClient) Update() *DeviceTypeUpdate

Update returns an update builder for DeviceType.

func (*DeviceTypeClient) UpdateOne

func (c *DeviceTypeClient) UpdateOne(dt *DeviceType) *DeviceTypeUpdateOne

UpdateOne returns an update builder for the given entity.

func (*DeviceTypeClient) UpdateOneID

func (c *DeviceTypeClient) UpdateOneID(id int) *DeviceTypeUpdateOne

UpdateOneID returns an update builder for the given id.

func (*DeviceTypeClient) Use

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

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

type DeviceTypeCreate

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

DeviceTypeCreate is the builder for creating a DeviceType entity.

func (*DeviceTypeCreate) AddTypeIDs

func (dtc *DeviceTypeCreate) AddTypeIDs(ids ...int) *DeviceTypeCreate

AddTypeIDs adds the "types" edge to the Device entity by IDs.

func (*DeviceTypeCreate) AddTypes

func (dtc *DeviceTypeCreate) AddTypes(d ...*Device) *DeviceTypeCreate

AddTypes adds the "types" edges to the Device entity.

func (*DeviceTypeCreate) Mutation

func (dtc *DeviceTypeCreate) Mutation() *DeviceTypeMutation

Mutation returns the DeviceTypeMutation object of the builder.

func (*DeviceTypeCreate) Save

func (dtc *DeviceTypeCreate) Save(ctx context.Context) (*DeviceType, error)

Save creates the DeviceType in the database.

func (*DeviceTypeCreate) SaveX

func (dtc *DeviceTypeCreate) SaveX(ctx context.Context) *DeviceType

SaveX calls Save and panics if Save returns an error.

func (*DeviceTypeCreate) SetDeviceTypeName

func (dtc *DeviceTypeCreate) SetDeviceTypeName(s string) *DeviceTypeCreate

SetDeviceTypeName sets the "device_type_name" field.

type DeviceTypeCreateBulk

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

DeviceTypeCreateBulk is the builder for creating many DeviceType entities in bulk.

func (*DeviceTypeCreateBulk) Save

func (dtcb *DeviceTypeCreateBulk) Save(ctx context.Context) ([]*DeviceType, error)

Save creates the DeviceType entities in the database.

func (*DeviceTypeCreateBulk) SaveX

func (dtcb *DeviceTypeCreateBulk) SaveX(ctx context.Context) []*DeviceType

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

type DeviceTypeDelete

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

DeviceTypeDelete is the builder for deleting a DeviceType entity.

func (*DeviceTypeDelete) Exec

func (dtd *DeviceTypeDelete) Exec(ctx context.Context) (int, error)

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

func (*DeviceTypeDelete) ExecX

func (dtd *DeviceTypeDelete) ExecX(ctx context.Context) int

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

func (*DeviceTypeDelete) Where

Where adds a new predicate to the DeviceTypeDelete builder.

type DeviceTypeDeleteOne

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

DeviceTypeDeleteOne is the builder for deleting a single DeviceType entity.

func (*DeviceTypeDeleteOne) Exec

func (dtdo *DeviceTypeDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*DeviceTypeDeleteOne) ExecX

func (dtdo *DeviceTypeDeleteOne) ExecX(ctx context.Context)

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

type DeviceTypeEdges

type DeviceTypeEdges struct {
	// Types holds the value of the types edge.
	Types []*Device `json:"types,omitempty"`
	// contains filtered or unexported fields
}

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

func (DeviceTypeEdges) TypesOrErr

func (e DeviceTypeEdges) TypesOrErr() ([]*Device, error)

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

type DeviceTypeGroupBy

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

DeviceTypeGroupBy is the group-by builder for DeviceType entities.

func (*DeviceTypeGroupBy) Aggregate

func (dtgb *DeviceTypeGroupBy) Aggregate(fns ...AggregateFunc) *DeviceTypeGroupBy

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

func (*DeviceTypeGroupBy) Bool

func (dtgb *DeviceTypeGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*DeviceTypeGroupBy) BoolX

func (dtgb *DeviceTypeGroupBy) BoolX(ctx context.Context) bool

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

func (*DeviceTypeGroupBy) Bools

func (dtgb *DeviceTypeGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*DeviceTypeGroupBy) BoolsX

func (dtgb *DeviceTypeGroupBy) BoolsX(ctx context.Context) []bool

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

func (*DeviceTypeGroupBy) Float64

func (dtgb *DeviceTypeGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*DeviceTypeGroupBy) Float64X

func (dtgb *DeviceTypeGroupBy) Float64X(ctx context.Context) float64

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

func (*DeviceTypeGroupBy) Float64s

func (dtgb *DeviceTypeGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*DeviceTypeGroupBy) Float64sX

func (dtgb *DeviceTypeGroupBy) Float64sX(ctx context.Context) []float64

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

func (*DeviceTypeGroupBy) Int

func (dtgb *DeviceTypeGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*DeviceTypeGroupBy) IntX

func (dtgb *DeviceTypeGroupBy) IntX(ctx context.Context) int

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

func (*DeviceTypeGroupBy) Ints

func (dtgb *DeviceTypeGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*DeviceTypeGroupBy) IntsX

func (dtgb *DeviceTypeGroupBy) IntsX(ctx context.Context) []int

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

func (*DeviceTypeGroupBy) Scan

func (dtgb *DeviceTypeGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*DeviceTypeGroupBy) ScanX

func (dtgb *DeviceTypeGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*DeviceTypeGroupBy) String

func (dtgb *DeviceTypeGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*DeviceTypeGroupBy) StringX

func (dtgb *DeviceTypeGroupBy) StringX(ctx context.Context) string

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

func (*DeviceTypeGroupBy) Strings

func (dtgb *DeviceTypeGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*DeviceTypeGroupBy) StringsX

func (dtgb *DeviceTypeGroupBy) StringsX(ctx context.Context) []string

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

type DeviceTypeMutation

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

DeviceTypeMutation represents an operation that mutates the DeviceType nodes in the graph.

func (*DeviceTypeMutation) AddField

func (m *DeviceTypeMutation) 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 (*DeviceTypeMutation) AddTypeIDs

func (m *DeviceTypeMutation) AddTypeIDs(ids ...int)

AddTypeIDs adds the "types" edge to the Device entity by ids.

func (*DeviceTypeMutation) AddedEdges

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

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

func (*DeviceTypeMutation) AddedField

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

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

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

func (*DeviceTypeMutation) AddedIDs

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

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

func (*DeviceTypeMutation) ClearEdge

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

func (m *DeviceTypeMutation) 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 (*DeviceTypeMutation) ClearTypes

func (m *DeviceTypeMutation) ClearTypes()

ClearTypes clears the "types" edge to the Device entity.

func (*DeviceTypeMutation) ClearedEdges

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

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

func (*DeviceTypeMutation) ClearedFields

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

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

func (DeviceTypeMutation) Client

func (m DeviceTypeMutation) 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 (*DeviceTypeMutation) DeviceTypeName

func (m *DeviceTypeMutation) DeviceTypeName() (r string, exists bool)

DeviceTypeName returns the value of the "device_type_name" field in the mutation.

func (*DeviceTypeMutation) EdgeCleared

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

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

func (*DeviceTypeMutation) Field

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

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

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

func (*DeviceTypeMutation) Fields

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

func (m *DeviceTypeMutation) 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.

func (*DeviceTypeMutation) OldDeviceTypeName

func (m *DeviceTypeMutation) OldDeviceTypeName(ctx context.Context) (v string, err error)

OldDeviceTypeName returns the old "device_type_name" field's value of the DeviceType entity. If the DeviceType 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 (*DeviceTypeMutation) OldField

func (m *DeviceTypeMutation) 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 (*DeviceTypeMutation) Op

func (m *DeviceTypeMutation) Op() Op

Op returns the operation name.

func (*DeviceTypeMutation) RemoveTypeIDs

func (m *DeviceTypeMutation) RemoveTypeIDs(ids ...int)

RemoveTypeIDs removes the "types" edge to the Device entity by IDs.

func (*DeviceTypeMutation) RemovedEdges

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

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

func (*DeviceTypeMutation) RemovedIDs

func (m *DeviceTypeMutation) 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 (*DeviceTypeMutation) RemovedTypesIDs

func (m *DeviceTypeMutation) RemovedTypesIDs() (ids []int)

RemovedTypes returns the removed IDs of the "types" edge to the Device entity.

func (*DeviceTypeMutation) ResetDeviceTypeName

func (m *DeviceTypeMutation) ResetDeviceTypeName()

ResetDeviceTypeName resets all changes to the "device_type_name" field.

func (*DeviceTypeMutation) ResetEdge

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

func (m *DeviceTypeMutation) 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 (*DeviceTypeMutation) ResetTypes

func (m *DeviceTypeMutation) ResetTypes()

ResetTypes resets all changes to the "types" edge.

func (*DeviceTypeMutation) SetDeviceTypeName

func (m *DeviceTypeMutation) SetDeviceTypeName(s string)

SetDeviceTypeName sets the "device_type_name" field.

func (*DeviceTypeMutation) SetField

func (m *DeviceTypeMutation) 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 (DeviceTypeMutation) Tx

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

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

func (*DeviceTypeMutation) Type

func (m *DeviceTypeMutation) Type() string

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

func (*DeviceTypeMutation) TypesCleared

func (m *DeviceTypeMutation) TypesCleared() bool

TypesCleared reports if the "types" edge to the Device entity was cleared.

func (*DeviceTypeMutation) TypesIDs

func (m *DeviceTypeMutation) TypesIDs() (ids []int)

TypesIDs returns the "types" edge IDs in the mutation.

type DeviceTypeQuery

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

DeviceTypeQuery is the builder for querying DeviceType entities.

func (*DeviceTypeQuery) All

func (dtq *DeviceTypeQuery) All(ctx context.Context) ([]*DeviceType, error)

All executes the query and returns a list of DeviceTypes.

func (*DeviceTypeQuery) AllX

func (dtq *DeviceTypeQuery) AllX(ctx context.Context) []*DeviceType

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

func (*DeviceTypeQuery) Clone

func (dtq *DeviceTypeQuery) Clone() *DeviceTypeQuery

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

func (*DeviceTypeQuery) Count

func (dtq *DeviceTypeQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*DeviceTypeQuery) CountX

func (dtq *DeviceTypeQuery) CountX(ctx context.Context) int

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

func (*DeviceTypeQuery) Exist

func (dtq *DeviceTypeQuery) Exist(ctx context.Context) (bool, error)

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

func (*DeviceTypeQuery) ExistX

func (dtq *DeviceTypeQuery) ExistX(ctx context.Context) bool

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

func (*DeviceTypeQuery) First

func (dtq *DeviceTypeQuery) First(ctx context.Context) (*DeviceType, error)

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

func (*DeviceTypeQuery) FirstID

func (dtq *DeviceTypeQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*DeviceTypeQuery) FirstIDX

func (dtq *DeviceTypeQuery) FirstIDX(ctx context.Context) int

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

func (*DeviceTypeQuery) FirstX

func (dtq *DeviceTypeQuery) FirstX(ctx context.Context) *DeviceType

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

func (*DeviceTypeQuery) GroupBy

func (dtq *DeviceTypeQuery) GroupBy(field string, fields ...string) *DeviceTypeGroupBy

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

client.DeviceType.Query().
	GroupBy(devicetype.FieldDeviceTypeName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*DeviceTypeQuery) IDs

func (dtq *DeviceTypeQuery) IDs(ctx context.Context) ([]int, error)

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

func (*DeviceTypeQuery) IDsX

func (dtq *DeviceTypeQuery) IDsX(ctx context.Context) []int

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

func (*DeviceTypeQuery) Limit

func (dtq *DeviceTypeQuery) Limit(limit int) *DeviceTypeQuery

Limit adds a limit step to the query.

func (*DeviceTypeQuery) Offset

func (dtq *DeviceTypeQuery) Offset(offset int) *DeviceTypeQuery

Offset adds an offset step to the query.

func (*DeviceTypeQuery) Only

func (dtq *DeviceTypeQuery) Only(ctx context.Context) (*DeviceType, error)

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

func (*DeviceTypeQuery) OnlyID

func (dtq *DeviceTypeQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*DeviceTypeQuery) OnlyIDX

func (dtq *DeviceTypeQuery) OnlyIDX(ctx context.Context) int

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

func (*DeviceTypeQuery) OnlyX

func (dtq *DeviceTypeQuery) OnlyX(ctx context.Context) *DeviceType

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

func (*DeviceTypeQuery) Order

func (dtq *DeviceTypeQuery) Order(o ...OrderFunc) *DeviceTypeQuery

Order adds an order step to the query.

func (*DeviceTypeQuery) QueryTypes

func (dtq *DeviceTypeQuery) QueryTypes() *DeviceQuery

QueryTypes chains the current query on the "types" edge.

func (*DeviceTypeQuery) Select

func (dtq *DeviceTypeQuery) Select(field string, fields ...string) *DeviceTypeSelect

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

client.DeviceType.Query().
	Select(devicetype.FieldDeviceTypeName).
	Scan(ctx, &v)

func (*DeviceTypeQuery) Unique

func (dtq *DeviceTypeQuery) Unique(unique bool) *DeviceTypeQuery

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

Where adds a new predicate for the DeviceTypeQuery builder.

func (*DeviceTypeQuery) WithTypes

func (dtq *DeviceTypeQuery) WithTypes(opts ...func(*DeviceQuery)) *DeviceTypeQuery

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

type DeviceTypeSelect

type DeviceTypeSelect struct {
	*DeviceTypeQuery
	// contains filtered or unexported fields
}

DeviceTypeSelect is the builder for selecting fields of DeviceType entities.

func (*DeviceTypeSelect) Bool

func (dts *DeviceTypeSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*DeviceTypeSelect) BoolX

func (dts *DeviceTypeSelect) BoolX(ctx context.Context) bool

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

func (*DeviceTypeSelect) Bools

func (dts *DeviceTypeSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*DeviceTypeSelect) BoolsX

func (dts *DeviceTypeSelect) BoolsX(ctx context.Context) []bool

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

func (*DeviceTypeSelect) Float64

func (dts *DeviceTypeSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*DeviceTypeSelect) Float64X

func (dts *DeviceTypeSelect) Float64X(ctx context.Context) float64

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

func (*DeviceTypeSelect) Float64s

func (dts *DeviceTypeSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*DeviceTypeSelect) Float64sX

func (dts *DeviceTypeSelect) Float64sX(ctx context.Context) []float64

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

func (*DeviceTypeSelect) Int

func (dts *DeviceTypeSelect) Int(ctx context.Context) (_ int, err error)

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

func (*DeviceTypeSelect) IntX

func (dts *DeviceTypeSelect) IntX(ctx context.Context) int

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

func (*DeviceTypeSelect) Ints

func (dts *DeviceTypeSelect) Ints(ctx context.Context) ([]int, error)

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

func (*DeviceTypeSelect) IntsX

func (dts *DeviceTypeSelect) IntsX(ctx context.Context) []int

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

func (*DeviceTypeSelect) Scan

func (dts *DeviceTypeSelect) Scan(ctx context.Context, v interface{}) error

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

func (*DeviceTypeSelect) ScanX

func (dts *DeviceTypeSelect) ScanX(ctx context.Context, v interface{})

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

func (*DeviceTypeSelect) String

func (dts *DeviceTypeSelect) String(ctx context.Context) (_ string, err error)

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

func (*DeviceTypeSelect) StringX

func (dts *DeviceTypeSelect) StringX(ctx context.Context) string

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

func (*DeviceTypeSelect) Strings

func (dts *DeviceTypeSelect) Strings(ctx context.Context) ([]string, error)

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

func (*DeviceTypeSelect) StringsX

func (dts *DeviceTypeSelect) StringsX(ctx context.Context) []string

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

type DeviceTypeUpdate

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

DeviceTypeUpdate is the builder for updating DeviceType entities.

func (*DeviceTypeUpdate) AddTypeIDs

func (dtu *DeviceTypeUpdate) AddTypeIDs(ids ...int) *DeviceTypeUpdate

AddTypeIDs adds the "types" edge to the Device entity by IDs.

func (*DeviceTypeUpdate) AddTypes

func (dtu *DeviceTypeUpdate) AddTypes(d ...*Device) *DeviceTypeUpdate

AddTypes adds the "types" edges to the Device entity.

func (*DeviceTypeUpdate) ClearTypes

func (dtu *DeviceTypeUpdate) ClearTypes() *DeviceTypeUpdate

ClearTypes clears all "types" edges to the Device entity.

func (*DeviceTypeUpdate) Exec

func (dtu *DeviceTypeUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*DeviceTypeUpdate) ExecX

func (dtu *DeviceTypeUpdate) ExecX(ctx context.Context)

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

func (*DeviceTypeUpdate) Mutation

func (dtu *DeviceTypeUpdate) Mutation() *DeviceTypeMutation

Mutation returns the DeviceTypeMutation object of the builder.

func (*DeviceTypeUpdate) RemoveTypeIDs

func (dtu *DeviceTypeUpdate) RemoveTypeIDs(ids ...int) *DeviceTypeUpdate

RemoveTypeIDs removes the "types" edge to Device entities by IDs.

func (*DeviceTypeUpdate) RemoveTypes

func (dtu *DeviceTypeUpdate) RemoveTypes(d ...*Device) *DeviceTypeUpdate

RemoveTypes removes "types" edges to Device entities.

func (*DeviceTypeUpdate) Save

func (dtu *DeviceTypeUpdate) Save(ctx context.Context) (int, error)

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

func (*DeviceTypeUpdate) SaveX

func (dtu *DeviceTypeUpdate) SaveX(ctx context.Context) int

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

func (*DeviceTypeUpdate) SetDeviceTypeName

func (dtu *DeviceTypeUpdate) SetDeviceTypeName(s string) *DeviceTypeUpdate

SetDeviceTypeName sets the "device_type_name" field.

func (*DeviceTypeUpdate) Where

Where adds a new predicate for the DeviceTypeUpdate builder.

type DeviceTypeUpdateOne

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

DeviceTypeUpdateOne is the builder for updating a single DeviceType entity.

func (*DeviceTypeUpdateOne) AddTypeIDs

func (dtuo *DeviceTypeUpdateOne) AddTypeIDs(ids ...int) *DeviceTypeUpdateOne

AddTypeIDs adds the "types" edge to the Device entity by IDs.

func (*DeviceTypeUpdateOne) AddTypes

func (dtuo *DeviceTypeUpdateOne) AddTypes(d ...*Device) *DeviceTypeUpdateOne

AddTypes adds the "types" edges to the Device entity.

func (*DeviceTypeUpdateOne) ClearTypes

func (dtuo *DeviceTypeUpdateOne) ClearTypes() *DeviceTypeUpdateOne

ClearTypes clears all "types" edges to the Device entity.

func (*DeviceTypeUpdateOne) Exec

func (dtuo *DeviceTypeUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*DeviceTypeUpdateOne) ExecX

func (dtuo *DeviceTypeUpdateOne) ExecX(ctx context.Context)

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

func (*DeviceTypeUpdateOne) Mutation

func (dtuo *DeviceTypeUpdateOne) Mutation() *DeviceTypeMutation

Mutation returns the DeviceTypeMutation object of the builder.

func (*DeviceTypeUpdateOne) RemoveTypeIDs

func (dtuo *DeviceTypeUpdateOne) RemoveTypeIDs(ids ...int) *DeviceTypeUpdateOne

RemoveTypeIDs removes the "types" edge to Device entities by IDs.

func (*DeviceTypeUpdateOne) RemoveTypes

func (dtuo *DeviceTypeUpdateOne) RemoveTypes(d ...*Device) *DeviceTypeUpdateOne

RemoveTypes removes "types" edges to Device entities.

func (*DeviceTypeUpdateOne) Save

func (dtuo *DeviceTypeUpdateOne) Save(ctx context.Context) (*DeviceType, error)

Save executes the query and returns the updated DeviceType entity.

func (*DeviceTypeUpdateOne) SaveX

func (dtuo *DeviceTypeUpdateOne) SaveX(ctx context.Context) *DeviceType

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

func (*DeviceTypeUpdateOne) Select

func (dtuo *DeviceTypeUpdateOne) Select(field string, fields ...string) *DeviceTypeUpdateOne

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

func (*DeviceTypeUpdateOne) SetDeviceTypeName

func (dtuo *DeviceTypeUpdateOne) SetDeviceTypeName(s string) *DeviceTypeUpdateOne

SetDeviceTypeName sets the "device_type_name" field.

type DeviceTypes

type DeviceTypes []*DeviceType

DeviceTypes is a parsable slice of DeviceType.

type DeviceUpdate

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

DeviceUpdate is the builder for updating Device entities.

func (*DeviceUpdate) AddDeletedVlanIDs

func (du *DeviceUpdate) AddDeletedVlanIDs(ids ...int) *DeviceUpdate

AddDeletedVlanIDs adds the "deleted_vlans" edge to the DeletedVlanLog entity by IDs.

func (*DeviceUpdate) AddDeletedVlans

func (du *DeviceUpdate) AddDeletedVlans(d ...*DeletedVlanLog) *DeviceUpdate

AddDeletedVlans adds the "deleted_vlans" edges to the DeletedVlanLog entity.

func (*DeviceUpdate) AddDeviceSSHPort

func (du *DeviceUpdate) AddDeviceSSHPort(i int) *DeviceUpdate

AddDeviceSSHPort adds i to the "device_ssh_port" field.

func (*DeviceUpdate) AddHaveIPAddressIDs added in v0.2.0

func (du *DeviceUpdate) AddHaveIPAddressIDs(ids ...int) *DeviceUpdate

AddHaveIPAddressIDs adds the "have_ip_addresses" edge to the IPAddress entity by IDs.

func (*DeviceUpdate) AddHaveIPAddresses added in v0.2.0

func (du *DeviceUpdate) AddHaveIPAddresses(i ...*IPAddress) *DeviceUpdate

AddHaveIPAddresses adds the "have_ip_addresses" edges to the IPAddress entity.

func (*DeviceUpdate) AddIPStaticRouting added in v0.2.0

func (du *DeviceUpdate) AddIPStaticRouting(i ...*IPStaticRoutingTable) *DeviceUpdate

AddIPStaticRouting adds the "ip_static_routing" edges to the IPStaticRoutingTable entity.

func (*DeviceUpdate) AddIPStaticRoutingIDs added in v0.2.0

func (du *DeviceUpdate) AddIPStaticRoutingIDs(ids ...int) *DeviceUpdate

AddIPStaticRoutingIDs adds the "ip_static_routing" edge to the IPStaticRoutingTable entity by IDs.

func (*DeviceUpdate) AddInTopology

func (du *DeviceUpdate) AddInTopology(n ...*NetTopologyDeviceMap) *DeviceUpdate

AddInTopology adds the "in_topology" edges to the NetTopologyDeviceMap entity.

func (*DeviceUpdate) AddInTopologyIDs

func (du *DeviceUpdate) AddInTopologyIDs(ids ...int) *DeviceUpdate

AddInTopologyIDs adds the "in_topology" edge to the NetTopologyDeviceMap entity by IDs.

func (*DeviceUpdate) AddInterfaceIDs

func (du *DeviceUpdate) AddInterfaceIDs(ids ...int) *DeviceUpdate

AddInterfaceIDs adds the "interfaces" edge to the NetInterface entity by IDs.

func (*DeviceUpdate) AddInterfaces

func (du *DeviceUpdate) AddInterfaces(n ...*NetInterface) *DeviceUpdate

AddInterfaces adds the "interfaces" edges to the NetInterface entity.

func (*DeviceUpdate) AddPoInterfaceIDs added in v0.2.0

func (du *DeviceUpdate) AddPoInterfaceIDs(ids ...int) *DeviceUpdate

AddPoInterfaceIDs adds the "po_interfaces" edge to the PortChannelInterface entity by IDs.

func (*DeviceUpdate) AddPoInterfaces added in v0.2.0

func (du *DeviceUpdate) AddPoInterfaces(p ...*PortChannelInterface) *DeviceUpdate

AddPoInterfaces adds the "po_interfaces" edges to the PortChannelInterface entity.

func (*DeviceUpdate) AddStoreVlanIDs

func (du *DeviceUpdate) AddStoreVlanIDs(ids ...int) *DeviceUpdate

AddStoreVlanIDs adds the "store_vlans" edge to the Vlan entity by IDs.

func (*DeviceUpdate) AddStoreVlans

func (du *DeviceUpdate) AddStoreVlans(v ...*Vlan) *DeviceUpdate

AddStoreVlans adds the "store_vlans" edges to the Vlan entity.

func (*DeviceUpdate) ClearDeletedVlans

func (du *DeviceUpdate) ClearDeletedVlans() *DeviceUpdate

ClearDeletedVlans clears all "deleted_vlans" edges to the DeletedVlanLog entity.

func (*DeviceUpdate) ClearDevicePassword

func (du *DeviceUpdate) ClearDevicePassword() *DeviceUpdate

ClearDevicePassword clears the value of the "device_password" field.

func (*DeviceUpdate) ClearDeviceSecret

func (du *DeviceUpdate) ClearDeviceSecret() *DeviceUpdate

ClearDeviceSecret clears the value of the "device_secret" field.

func (*DeviceUpdate) ClearDeviceUsername

func (du *DeviceUpdate) ClearDeviceUsername() *DeviceUpdate

ClearDeviceUsername clears the value of the "device_username" field.

func (*DeviceUpdate) ClearHaveIPAddresses added in v0.2.0

func (du *DeviceUpdate) ClearHaveIPAddresses() *DeviceUpdate

ClearHaveIPAddresses clears all "have_ip_addresses" edges to the IPAddress entity.

func (*DeviceUpdate) ClearIPStaticRouting added in v0.2.0

func (du *DeviceUpdate) ClearIPStaticRouting() *DeviceUpdate

ClearIPStaticRouting clears all "ip_static_routing" edges to the IPStaticRoutingTable entity.

func (*DeviceUpdate) ClearInPlatform

func (du *DeviceUpdate) ClearInPlatform() *DeviceUpdate

ClearInPlatform clears the "in_platform" edge to the DevicePlatform entity.

func (*DeviceUpdate) ClearInTopology

func (du *DeviceUpdate) ClearInTopology() *DeviceUpdate

ClearInTopology clears all "in_topology" edges to the NetTopologyDeviceMap entity.

func (*DeviceUpdate) ClearInType

func (du *DeviceUpdate) ClearInType() *DeviceUpdate

ClearInType clears the "in_type" edge to the DeviceType entity.

func (*DeviceUpdate) ClearInterfaces

func (du *DeviceUpdate) ClearInterfaces() *DeviceUpdate

ClearInterfaces clears all "interfaces" edges to the NetInterface entity.

func (*DeviceUpdate) ClearPoInterfaces added in v0.2.0

func (du *DeviceUpdate) ClearPoInterfaces() *DeviceUpdate

ClearPoInterfaces clears all "po_interfaces" edges to the PortChannelInterface entity.

func (*DeviceUpdate) ClearStoreVlans

func (du *DeviceUpdate) ClearStoreVlans() *DeviceUpdate

ClearStoreVlans clears all "store_vlans" edges to the Vlan entity.

func (*DeviceUpdate) Exec

func (du *DeviceUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*DeviceUpdate) ExecX

func (du *DeviceUpdate) ExecX(ctx context.Context)

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

func (*DeviceUpdate) Mutation

func (du *DeviceUpdate) Mutation() *DeviceMutation

Mutation returns the DeviceMutation object of the builder.

func (*DeviceUpdate) RemoveDeletedVlanIDs

func (du *DeviceUpdate) RemoveDeletedVlanIDs(ids ...int) *DeviceUpdate

RemoveDeletedVlanIDs removes the "deleted_vlans" edge to DeletedVlanLog entities by IDs.

func (*DeviceUpdate) RemoveDeletedVlans

func (du *DeviceUpdate) RemoveDeletedVlans(d ...*DeletedVlanLog) *DeviceUpdate

RemoveDeletedVlans removes "deleted_vlans" edges to DeletedVlanLog entities.

func (*DeviceUpdate) RemoveHaveIPAddressIDs added in v0.2.0

func (du *DeviceUpdate) RemoveHaveIPAddressIDs(ids ...int) *DeviceUpdate

RemoveHaveIPAddressIDs removes the "have_ip_addresses" edge to IPAddress entities by IDs.

func (*DeviceUpdate) RemoveHaveIPAddresses added in v0.2.0

func (du *DeviceUpdate) RemoveHaveIPAddresses(i ...*IPAddress) *DeviceUpdate

RemoveHaveIPAddresses removes "have_ip_addresses" edges to IPAddress entities.

func (*DeviceUpdate) RemoveIPStaticRouting added in v0.2.0

func (du *DeviceUpdate) RemoveIPStaticRouting(i ...*IPStaticRoutingTable) *DeviceUpdate

RemoveIPStaticRouting removes "ip_static_routing" edges to IPStaticRoutingTable entities.

func (*DeviceUpdate) RemoveIPStaticRoutingIDs added in v0.2.0

func (du *DeviceUpdate) RemoveIPStaticRoutingIDs(ids ...int) *DeviceUpdate

RemoveIPStaticRoutingIDs removes the "ip_static_routing" edge to IPStaticRoutingTable entities by IDs.

func (*DeviceUpdate) RemoveInTopology

func (du *DeviceUpdate) RemoveInTopology(n ...*NetTopologyDeviceMap) *DeviceUpdate

RemoveInTopology removes "in_topology" edges to NetTopologyDeviceMap entities.

func (*DeviceUpdate) RemoveInTopologyIDs

func (du *DeviceUpdate) RemoveInTopologyIDs(ids ...int) *DeviceUpdate

RemoveInTopologyIDs removes the "in_topology" edge to NetTopologyDeviceMap entities by IDs.

func (*DeviceUpdate) RemoveInterfaceIDs

func (du *DeviceUpdate) RemoveInterfaceIDs(ids ...int) *DeviceUpdate

RemoveInterfaceIDs removes the "interfaces" edge to NetInterface entities by IDs.

func (*DeviceUpdate) RemoveInterfaces

func (du *DeviceUpdate) RemoveInterfaces(n ...*NetInterface) *DeviceUpdate

RemoveInterfaces removes "interfaces" edges to NetInterface entities.

func (*DeviceUpdate) RemovePoInterfaceIDs added in v0.2.0

func (du *DeviceUpdate) RemovePoInterfaceIDs(ids ...int) *DeviceUpdate

RemovePoInterfaceIDs removes the "po_interfaces" edge to PortChannelInterface entities by IDs.

func (*DeviceUpdate) RemovePoInterfaces added in v0.2.0

func (du *DeviceUpdate) RemovePoInterfaces(p ...*PortChannelInterface) *DeviceUpdate

RemovePoInterfaces removes "po_interfaces" edges to PortChannelInterface entities.

func (*DeviceUpdate) RemoveStoreVlanIDs

func (du *DeviceUpdate) RemoveStoreVlanIDs(ids ...int) *DeviceUpdate

RemoveStoreVlanIDs removes the "store_vlans" edge to Vlan entities by IDs.

func (*DeviceUpdate) RemoveStoreVlans

func (du *DeviceUpdate) RemoveStoreVlans(v ...*Vlan) *DeviceUpdate

RemoveStoreVlans removes "store_vlans" edges to Vlan entities.

func (*DeviceUpdate) Save

func (du *DeviceUpdate) Save(ctx context.Context) (int, error)

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

func (*DeviceUpdate) SaveX

func (du *DeviceUpdate) SaveX(ctx context.Context) int

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

func (*DeviceUpdate) SetDeviceCommitConfig

func (du *DeviceUpdate) SetDeviceCommitConfig(b bool) *DeviceUpdate

SetDeviceCommitConfig sets the "device_commit_config" field.

func (*DeviceUpdate) SetDeviceHostname

func (du *DeviceUpdate) SetDeviceHostname(s string) *DeviceUpdate

SetDeviceHostname sets the "device_hostname" field.

func (*DeviceUpdate) SetDeviceName

func (du *DeviceUpdate) SetDeviceName(s string) *DeviceUpdate

SetDeviceName sets the "device_name" field.

func (*DeviceUpdate) SetDevicePassword

func (du *DeviceUpdate) SetDevicePassword(s string) *DeviceUpdate

SetDevicePassword sets the "device_password" field.

func (*DeviceUpdate) SetDeviceSSHPort

func (du *DeviceUpdate) SetDeviceSSHPort(i int) *DeviceUpdate

SetDeviceSSHPort sets the "device_ssh_port" field.

func (*DeviceUpdate) SetDeviceSecret

func (du *DeviceUpdate) SetDeviceSecret(s string) *DeviceUpdate

SetDeviceSecret sets the "device_secret" field.

func (*DeviceUpdate) SetDeviceUsername

func (du *DeviceUpdate) SetDeviceUsername(s string) *DeviceUpdate

SetDeviceUsername sets the "device_username" field.

func (*DeviceUpdate) SetInPlatform

func (du *DeviceUpdate) SetInPlatform(d *DevicePlatform) *DeviceUpdate

SetInPlatform sets the "in_platform" edge to the DevicePlatform entity.

func (*DeviceUpdate) SetInPlatformID

func (du *DeviceUpdate) SetInPlatformID(id int) *DeviceUpdate

SetInPlatformID sets the "in_platform" edge to the DevicePlatform entity by ID.

func (*DeviceUpdate) SetInType

func (du *DeviceUpdate) SetInType(d *DeviceType) *DeviceUpdate

SetInType sets the "in_type" edge to the DeviceType entity.

func (*DeviceUpdate) SetInTypeID

func (du *DeviceUpdate) SetInTypeID(id int) *DeviceUpdate

SetInTypeID sets the "in_type" edge to the DeviceType entity by ID.

func (*DeviceUpdate) SetNillableDeviceCommitConfig

func (du *DeviceUpdate) SetNillableDeviceCommitConfig(b *bool) *DeviceUpdate

SetNillableDeviceCommitConfig sets the "device_commit_config" field if the given value is not nil.

func (*DeviceUpdate) SetNillableDevicePassword

func (du *DeviceUpdate) SetNillableDevicePassword(s *string) *DeviceUpdate

SetNillableDevicePassword sets the "device_password" field if the given value is not nil.

func (*DeviceUpdate) SetNillableDeviceSSHPort

func (du *DeviceUpdate) SetNillableDeviceSSHPort(i *int) *DeviceUpdate

SetNillableDeviceSSHPort sets the "device_ssh_port" field if the given value is not nil.

func (*DeviceUpdate) SetNillableDeviceSecret

func (du *DeviceUpdate) SetNillableDeviceSecret(s *string) *DeviceUpdate

SetNillableDeviceSecret sets the "device_secret" field if the given value is not nil.

func (*DeviceUpdate) SetNillableDeviceUsername

func (du *DeviceUpdate) SetNillableDeviceUsername(s *string) *DeviceUpdate

SetNillableDeviceUsername sets the "device_username" field if the given value is not nil.

func (*DeviceUpdate) SetNillableInPlatformID

func (du *DeviceUpdate) SetNillableInPlatformID(id *int) *DeviceUpdate

SetNillableInPlatformID sets the "in_platform" edge to the DevicePlatform entity by ID if the given value is not nil.

func (*DeviceUpdate) SetNillableInTypeID

func (du *DeviceUpdate) SetNillableInTypeID(id *int) *DeviceUpdate

SetNillableInTypeID sets the "in_type" edge to the DeviceType entity by ID if the given value is not nil.

func (*DeviceUpdate) Where

func (du *DeviceUpdate) Where(ps ...predicate.Device) *DeviceUpdate

Where adds a new predicate for the DeviceUpdate builder.

type DeviceUpdateOne

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

DeviceUpdateOne is the builder for updating a single Device entity.

func (*DeviceUpdateOne) AddDeletedVlanIDs

func (duo *DeviceUpdateOne) AddDeletedVlanIDs(ids ...int) *DeviceUpdateOne

AddDeletedVlanIDs adds the "deleted_vlans" edge to the DeletedVlanLog entity by IDs.

func (*DeviceUpdateOne) AddDeletedVlans

func (duo *DeviceUpdateOne) AddDeletedVlans(d ...*DeletedVlanLog) *DeviceUpdateOne

AddDeletedVlans adds the "deleted_vlans" edges to the DeletedVlanLog entity.

func (*DeviceUpdateOne) AddDeviceSSHPort

func (duo *DeviceUpdateOne) AddDeviceSSHPort(i int) *DeviceUpdateOne

AddDeviceSSHPort adds i to the "device_ssh_port" field.

func (*DeviceUpdateOne) AddHaveIPAddressIDs added in v0.2.0

func (duo *DeviceUpdateOne) AddHaveIPAddressIDs(ids ...int) *DeviceUpdateOne

AddHaveIPAddressIDs adds the "have_ip_addresses" edge to the IPAddress entity by IDs.

func (*DeviceUpdateOne) AddHaveIPAddresses added in v0.2.0

func (duo *DeviceUpdateOne) AddHaveIPAddresses(i ...*IPAddress) *DeviceUpdateOne

AddHaveIPAddresses adds the "have_ip_addresses" edges to the IPAddress entity.

func (*DeviceUpdateOne) AddIPStaticRouting added in v0.2.0

func (duo *DeviceUpdateOne) AddIPStaticRouting(i ...*IPStaticRoutingTable) *DeviceUpdateOne

AddIPStaticRouting adds the "ip_static_routing" edges to the IPStaticRoutingTable entity.

func (*DeviceUpdateOne) AddIPStaticRoutingIDs added in v0.2.0

func (duo *DeviceUpdateOne) AddIPStaticRoutingIDs(ids ...int) *DeviceUpdateOne

AddIPStaticRoutingIDs adds the "ip_static_routing" edge to the IPStaticRoutingTable entity by IDs.

func (*DeviceUpdateOne) AddInTopology

func (duo *DeviceUpdateOne) AddInTopology(n ...*NetTopologyDeviceMap) *DeviceUpdateOne

AddInTopology adds the "in_topology" edges to the NetTopologyDeviceMap entity.

func (*DeviceUpdateOne) AddInTopologyIDs

func (duo *DeviceUpdateOne) AddInTopologyIDs(ids ...int) *DeviceUpdateOne

AddInTopologyIDs adds the "in_topology" edge to the NetTopologyDeviceMap entity by IDs.

func (*DeviceUpdateOne) AddInterfaceIDs

func (duo *DeviceUpdateOne) AddInterfaceIDs(ids ...int) *DeviceUpdateOne

AddInterfaceIDs adds the "interfaces" edge to the NetInterface entity by IDs.

func (*DeviceUpdateOne) AddInterfaces

func (duo *DeviceUpdateOne) AddInterfaces(n ...*NetInterface) *DeviceUpdateOne

AddInterfaces adds the "interfaces" edges to the NetInterface entity.

func (*DeviceUpdateOne) AddPoInterfaceIDs added in v0.2.0

func (duo *DeviceUpdateOne) AddPoInterfaceIDs(ids ...int) *DeviceUpdateOne

AddPoInterfaceIDs adds the "po_interfaces" edge to the PortChannelInterface entity by IDs.

func (*DeviceUpdateOne) AddPoInterfaces added in v0.2.0

func (duo *DeviceUpdateOne) AddPoInterfaces(p ...*PortChannelInterface) *DeviceUpdateOne

AddPoInterfaces adds the "po_interfaces" edges to the PortChannelInterface entity.

func (*DeviceUpdateOne) AddStoreVlanIDs

func (duo *DeviceUpdateOne) AddStoreVlanIDs(ids ...int) *DeviceUpdateOne

AddStoreVlanIDs adds the "store_vlans" edge to the Vlan entity by IDs.

func (*DeviceUpdateOne) AddStoreVlans

func (duo *DeviceUpdateOne) AddStoreVlans(v ...*Vlan) *DeviceUpdateOne

AddStoreVlans adds the "store_vlans" edges to the Vlan entity.

func (*DeviceUpdateOne) ClearDeletedVlans

func (duo *DeviceUpdateOne) ClearDeletedVlans() *DeviceUpdateOne

ClearDeletedVlans clears all "deleted_vlans" edges to the DeletedVlanLog entity.

func (*DeviceUpdateOne) ClearDevicePassword

func (duo *DeviceUpdateOne) ClearDevicePassword() *DeviceUpdateOne

ClearDevicePassword clears the value of the "device_password" field.

func (*DeviceUpdateOne) ClearDeviceSecret

func (duo *DeviceUpdateOne) ClearDeviceSecret() *DeviceUpdateOne

ClearDeviceSecret clears the value of the "device_secret" field.

func (*DeviceUpdateOne) ClearDeviceUsername

func (duo *DeviceUpdateOne) ClearDeviceUsername() *DeviceUpdateOne

ClearDeviceUsername clears the value of the "device_username" field.

func (*DeviceUpdateOne) ClearHaveIPAddresses added in v0.2.0

func (duo *DeviceUpdateOne) ClearHaveIPAddresses() *DeviceUpdateOne

ClearHaveIPAddresses clears all "have_ip_addresses" edges to the IPAddress entity.

func (*DeviceUpdateOne) ClearIPStaticRouting added in v0.2.0

func (duo *DeviceUpdateOne) ClearIPStaticRouting() *DeviceUpdateOne

ClearIPStaticRouting clears all "ip_static_routing" edges to the IPStaticRoutingTable entity.

func (*DeviceUpdateOne) ClearInPlatform

func (duo *DeviceUpdateOne) ClearInPlatform() *DeviceUpdateOne

ClearInPlatform clears the "in_platform" edge to the DevicePlatform entity.

func (*DeviceUpdateOne) ClearInTopology

func (duo *DeviceUpdateOne) ClearInTopology() *DeviceUpdateOne

ClearInTopology clears all "in_topology" edges to the NetTopologyDeviceMap entity.

func (*DeviceUpdateOne) ClearInType

func (duo *DeviceUpdateOne) ClearInType() *DeviceUpdateOne

ClearInType clears the "in_type" edge to the DeviceType entity.

func (*DeviceUpdateOne) ClearInterfaces

func (duo *DeviceUpdateOne) ClearInterfaces() *DeviceUpdateOne

ClearInterfaces clears all "interfaces" edges to the NetInterface entity.

func (*DeviceUpdateOne) ClearPoInterfaces added in v0.2.0

func (duo *DeviceUpdateOne) ClearPoInterfaces() *DeviceUpdateOne

ClearPoInterfaces clears all "po_interfaces" edges to the PortChannelInterface entity.

func (*DeviceUpdateOne) ClearStoreVlans

func (duo *DeviceUpdateOne) ClearStoreVlans() *DeviceUpdateOne

ClearStoreVlans clears all "store_vlans" edges to the Vlan entity.

func (*DeviceUpdateOne) Exec

func (duo *DeviceUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*DeviceUpdateOne) ExecX

func (duo *DeviceUpdateOne) ExecX(ctx context.Context)

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

func (*DeviceUpdateOne) Mutation

func (duo *DeviceUpdateOne) Mutation() *DeviceMutation

Mutation returns the DeviceMutation object of the builder.

func (*DeviceUpdateOne) RemoveDeletedVlanIDs

func (duo *DeviceUpdateOne) RemoveDeletedVlanIDs(ids ...int) *DeviceUpdateOne

RemoveDeletedVlanIDs removes the "deleted_vlans" edge to DeletedVlanLog entities by IDs.

func (*DeviceUpdateOne) RemoveDeletedVlans

func (duo *DeviceUpdateOne) RemoveDeletedVlans(d ...*DeletedVlanLog) *DeviceUpdateOne

RemoveDeletedVlans removes "deleted_vlans" edges to DeletedVlanLog entities.

func (*DeviceUpdateOne) RemoveHaveIPAddressIDs added in v0.2.0

func (duo *DeviceUpdateOne) RemoveHaveIPAddressIDs(ids ...int) *DeviceUpdateOne

RemoveHaveIPAddressIDs removes the "have_ip_addresses" edge to IPAddress entities by IDs.

func (*DeviceUpdateOne) RemoveHaveIPAddresses added in v0.2.0

func (duo *DeviceUpdateOne) RemoveHaveIPAddresses(i ...*IPAddress) *DeviceUpdateOne

RemoveHaveIPAddresses removes "have_ip_addresses" edges to IPAddress entities.

func (*DeviceUpdateOne) RemoveIPStaticRouting added in v0.2.0

func (duo *DeviceUpdateOne) RemoveIPStaticRouting(i ...*IPStaticRoutingTable) *DeviceUpdateOne

RemoveIPStaticRouting removes "ip_static_routing" edges to IPStaticRoutingTable entities.

func (*DeviceUpdateOne) RemoveIPStaticRoutingIDs added in v0.2.0

func (duo *DeviceUpdateOne) RemoveIPStaticRoutingIDs(ids ...int) *DeviceUpdateOne

RemoveIPStaticRoutingIDs removes the "ip_static_routing" edge to IPStaticRoutingTable entities by IDs.

func (*DeviceUpdateOne) RemoveInTopology

func (duo *DeviceUpdateOne) RemoveInTopology(n ...*NetTopologyDeviceMap) *DeviceUpdateOne

RemoveInTopology removes "in_topology" edges to NetTopologyDeviceMap entities.

func (*DeviceUpdateOne) RemoveInTopologyIDs

func (duo *DeviceUpdateOne) RemoveInTopologyIDs(ids ...int) *DeviceUpdateOne

RemoveInTopologyIDs removes the "in_topology" edge to NetTopologyDeviceMap entities by IDs.

func (*DeviceUpdateOne) RemoveInterfaceIDs

func (duo *DeviceUpdateOne) RemoveInterfaceIDs(ids ...int) *DeviceUpdateOne

RemoveInterfaceIDs removes the "interfaces" edge to NetInterface entities by IDs.

func (*DeviceUpdateOne) RemoveInterfaces

func (duo *DeviceUpdateOne) RemoveInterfaces(n ...*NetInterface) *DeviceUpdateOne

RemoveInterfaces removes "interfaces" edges to NetInterface entities.

func (*DeviceUpdateOne) RemovePoInterfaceIDs added in v0.2.0

func (duo *DeviceUpdateOne) RemovePoInterfaceIDs(ids ...int) *DeviceUpdateOne

RemovePoInterfaceIDs removes the "po_interfaces" edge to PortChannelInterface entities by IDs.

func (*DeviceUpdateOne) RemovePoInterfaces added in v0.2.0

func (duo *DeviceUpdateOne) RemovePoInterfaces(p ...*PortChannelInterface) *DeviceUpdateOne

RemovePoInterfaces removes "po_interfaces" edges to PortChannelInterface entities.

func (*DeviceUpdateOne) RemoveStoreVlanIDs

func (duo *DeviceUpdateOne) RemoveStoreVlanIDs(ids ...int) *DeviceUpdateOne

RemoveStoreVlanIDs removes the "store_vlans" edge to Vlan entities by IDs.

func (*DeviceUpdateOne) RemoveStoreVlans

func (duo *DeviceUpdateOne) RemoveStoreVlans(v ...*Vlan) *DeviceUpdateOne

RemoveStoreVlans removes "store_vlans" edges to Vlan entities.

func (*DeviceUpdateOne) Save

func (duo *DeviceUpdateOne) Save(ctx context.Context) (*Device, error)

Save executes the query and returns the updated Device entity.

func (*DeviceUpdateOne) SaveX

func (duo *DeviceUpdateOne) SaveX(ctx context.Context) *Device

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

func (*DeviceUpdateOne) Select

func (duo *DeviceUpdateOne) Select(field string, fields ...string) *DeviceUpdateOne

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

func (*DeviceUpdateOne) SetDeviceCommitConfig

func (duo *DeviceUpdateOne) SetDeviceCommitConfig(b bool) *DeviceUpdateOne

SetDeviceCommitConfig sets the "device_commit_config" field.

func (*DeviceUpdateOne) SetDeviceHostname

func (duo *DeviceUpdateOne) SetDeviceHostname(s string) *DeviceUpdateOne

SetDeviceHostname sets the "device_hostname" field.

func (*DeviceUpdateOne) SetDeviceName

func (duo *DeviceUpdateOne) SetDeviceName(s string) *DeviceUpdateOne

SetDeviceName sets the "device_name" field.

func (*DeviceUpdateOne) SetDevicePassword

func (duo *DeviceUpdateOne) SetDevicePassword(s string) *DeviceUpdateOne

SetDevicePassword sets the "device_password" field.

func (*DeviceUpdateOne) SetDeviceSSHPort

func (duo *DeviceUpdateOne) SetDeviceSSHPort(i int) *DeviceUpdateOne

SetDeviceSSHPort sets the "device_ssh_port" field.

func (*DeviceUpdateOne) SetDeviceSecret

func (duo *DeviceUpdateOne) SetDeviceSecret(s string) *DeviceUpdateOne

SetDeviceSecret sets the "device_secret" field.

func (*DeviceUpdateOne) SetDeviceUsername

func (duo *DeviceUpdateOne) SetDeviceUsername(s string) *DeviceUpdateOne

SetDeviceUsername sets the "device_username" field.

func (*DeviceUpdateOne) SetInPlatform

func (duo *DeviceUpdateOne) SetInPlatform(d *DevicePlatform) *DeviceUpdateOne

SetInPlatform sets the "in_platform" edge to the DevicePlatform entity.

func (*DeviceUpdateOne) SetInPlatformID

func (duo *DeviceUpdateOne) SetInPlatformID(id int) *DeviceUpdateOne

SetInPlatformID sets the "in_platform" edge to the DevicePlatform entity by ID.

func (*DeviceUpdateOne) SetInType

func (duo *DeviceUpdateOne) SetInType(d *DeviceType) *DeviceUpdateOne

SetInType sets the "in_type" edge to the DeviceType entity.

func (*DeviceUpdateOne) SetInTypeID

func (duo *DeviceUpdateOne) SetInTypeID(id int) *DeviceUpdateOne

SetInTypeID sets the "in_type" edge to the DeviceType entity by ID.

func (*DeviceUpdateOne) SetNillableDeviceCommitConfig

func (duo *DeviceUpdateOne) SetNillableDeviceCommitConfig(b *bool) *DeviceUpdateOne

SetNillableDeviceCommitConfig sets the "device_commit_config" field if the given value is not nil.

func (*DeviceUpdateOne) SetNillableDevicePassword

func (duo *DeviceUpdateOne) SetNillableDevicePassword(s *string) *DeviceUpdateOne

SetNillableDevicePassword sets the "device_password" field if the given value is not nil.

func (*DeviceUpdateOne) SetNillableDeviceSSHPort

func (duo *DeviceUpdateOne) SetNillableDeviceSSHPort(i *int) *DeviceUpdateOne

SetNillableDeviceSSHPort sets the "device_ssh_port" field if the given value is not nil.

func (*DeviceUpdateOne) SetNillableDeviceSecret

func (duo *DeviceUpdateOne) SetNillableDeviceSecret(s *string) *DeviceUpdateOne

SetNillableDeviceSecret sets the "device_secret" field if the given value is not nil.

func (*DeviceUpdateOne) SetNillableDeviceUsername

func (duo *DeviceUpdateOne) SetNillableDeviceUsername(s *string) *DeviceUpdateOne

SetNillableDeviceUsername sets the "device_username" field if the given value is not nil.

func (*DeviceUpdateOne) SetNillableInPlatformID

func (duo *DeviceUpdateOne) SetNillableInPlatformID(id *int) *DeviceUpdateOne

SetNillableInPlatformID sets the "in_platform" edge to the DevicePlatform entity by ID if the given value is not nil.

func (*DeviceUpdateOne) SetNillableInTypeID

func (duo *DeviceUpdateOne) SetNillableInTypeID(id *int) *DeviceUpdateOne

SetNillableInTypeID sets the "in_type" edge to the DeviceType entity by ID if the given value is not nil.

type Devices

type Devices []*Device

Devices is a parsable slice of Device.

type Hook

type Hook = ent.Hook

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

type IPAddress added in v0.2.0

type IPAddress struct {

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

IPAddress is the model entity for the IPAddress schema.

func (*IPAddress) QueryInterfaces added in v0.2.0

func (ia *IPAddress) QueryInterfaces() *NetInterfaceQuery

QueryInterfaces queries the "interfaces" edge of the IPAddress entity.

func (*IPAddress) QueryOnDevice added in v0.2.0

func (ia *IPAddress) QueryOnDevice() *DeviceQuery

QueryOnDevice queries the "on_device" edge of the IPAddress entity.

func (*IPAddress) QueryPoInterfaces added in v0.2.0

func (ia *IPAddress) QueryPoInterfaces() *PortChannelInterfaceQuery

QueryPoInterfaces queries the "po_interfaces" edge of the IPAddress entity.

func (*IPAddress) String added in v0.2.0

func (ia *IPAddress) String() string

String implements the fmt.Stringer.

func (*IPAddress) Unwrap added in v0.2.0

func (ia *IPAddress) Unwrap() *IPAddress

Unwrap unwraps the IPAddress 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 (*IPAddress) Update added in v0.2.0

func (ia *IPAddress) Update() *IPAddressUpdateOne

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

type IPAddressClient added in v0.2.0

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

IPAddressClient is a client for the IPAddress schema.

func NewIPAddressClient added in v0.2.0

func NewIPAddressClient(c config) *IPAddressClient

NewIPAddressClient returns a client for the IPAddress from the given config.

func (*IPAddressClient) Create added in v0.2.0

func (c *IPAddressClient) Create() *IPAddressCreate

Create returns a create builder for IPAddress.

func (*IPAddressClient) CreateBulk added in v0.2.0

func (c *IPAddressClient) CreateBulk(builders ...*IPAddressCreate) *IPAddressCreateBulk

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

func (*IPAddressClient) Delete added in v0.2.0

func (c *IPAddressClient) Delete() *IPAddressDelete

Delete returns a delete builder for IPAddress.

func (*IPAddressClient) DeleteOne added in v0.2.0

func (c *IPAddressClient) DeleteOne(ia *IPAddress) *IPAddressDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*IPAddressClient) DeleteOneID added in v0.2.0

func (c *IPAddressClient) DeleteOneID(id int) *IPAddressDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*IPAddressClient) Get added in v0.2.0

func (c *IPAddressClient) Get(ctx context.Context, id int) (*IPAddress, error)

Get returns a IPAddress entity by its id.

func (*IPAddressClient) GetX added in v0.2.0

func (c *IPAddressClient) GetX(ctx context.Context, id int) *IPAddress

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

func (*IPAddressClient) Hooks added in v0.2.0

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

Hooks returns the client hooks.

func (*IPAddressClient) Query added in v0.2.0

func (c *IPAddressClient) Query() *IPAddressQuery

Query returns a query builder for IPAddress.

func (*IPAddressClient) QueryInterfaces added in v0.2.0

func (c *IPAddressClient) QueryInterfaces(ia *IPAddress) *NetInterfaceQuery

QueryInterfaces queries the interfaces edge of a IPAddress.

func (*IPAddressClient) QueryOnDevice added in v0.2.0

func (c *IPAddressClient) QueryOnDevice(ia *IPAddress) *DeviceQuery

QueryOnDevice queries the on_device edge of a IPAddress.

func (*IPAddressClient) QueryPoInterfaces added in v0.2.0

func (c *IPAddressClient) QueryPoInterfaces(ia *IPAddress) *PortChannelInterfaceQuery

QueryPoInterfaces queries the po_interfaces edge of a IPAddress.

func (*IPAddressClient) Update added in v0.2.0

func (c *IPAddressClient) Update() *IPAddressUpdate

Update returns an update builder for IPAddress.

func (*IPAddressClient) UpdateOne added in v0.2.0

func (c *IPAddressClient) UpdateOne(ia *IPAddress) *IPAddressUpdateOne

UpdateOne returns an update builder for the given entity.

func (*IPAddressClient) UpdateOneID added in v0.2.0

func (c *IPAddressClient) UpdateOneID(id int) *IPAddressUpdateOne

UpdateOneID returns an update builder for the given id.

func (*IPAddressClient) Use added in v0.2.0

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

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

type IPAddressCreate added in v0.2.0

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

IPAddressCreate is the builder for creating a IPAddress entity.

func (*IPAddressCreate) AddInterfaceIDs added in v0.2.0

func (iac *IPAddressCreate) AddInterfaceIDs(ids ...int) *IPAddressCreate

AddInterfaceIDs adds the "interfaces" edge to the NetInterface entity by IDs.

func (*IPAddressCreate) AddInterfaces added in v0.2.0

func (iac *IPAddressCreate) AddInterfaces(n ...*NetInterface) *IPAddressCreate

AddInterfaces adds the "interfaces" edges to the NetInterface entity.

func (*IPAddressCreate) AddPoInterfaceIDs added in v0.2.0

func (iac *IPAddressCreate) AddPoInterfaceIDs(ids ...int) *IPAddressCreate

AddPoInterfaceIDs adds the "po_interfaces" edge to the PortChannelInterface entity by IDs.

func (*IPAddressCreate) AddPoInterfaces added in v0.2.0

func (iac *IPAddressCreate) AddPoInterfaces(p ...*PortChannelInterface) *IPAddressCreate

AddPoInterfaces adds the "po_interfaces" edges to the PortChannelInterface entity.

func (*IPAddressCreate) Mutation added in v0.2.0

func (iac *IPAddressCreate) Mutation() *IPAddressMutation

Mutation returns the IPAddressMutation object of the builder.

func (*IPAddressCreate) Save added in v0.2.0

func (iac *IPAddressCreate) Save(ctx context.Context) (*IPAddress, error)

Save creates the IPAddress in the database.

func (*IPAddressCreate) SaveX added in v0.2.0

func (iac *IPAddressCreate) SaveX(ctx context.Context) *IPAddress

SaveX calls Save and panics if Save returns an error.

func (*IPAddressCreate) SetIPAddress added in v0.2.0

func (iac *IPAddressCreate) SetIPAddress(s string) *IPAddressCreate

SetIPAddress sets the "ip_address" field.

func (*IPAddressCreate) SetNillableOnDeviceID added in v0.2.0

func (iac *IPAddressCreate) SetNillableOnDeviceID(id *int) *IPAddressCreate

SetNillableOnDeviceID sets the "on_device" edge to the Device entity by ID if the given value is not nil.

func (*IPAddressCreate) SetOnDevice added in v0.2.0

func (iac *IPAddressCreate) SetOnDevice(d *Device) *IPAddressCreate

SetOnDevice sets the "on_device" edge to the Device entity.

func (*IPAddressCreate) SetOnDeviceID added in v0.2.0

func (iac *IPAddressCreate) SetOnDeviceID(id int) *IPAddressCreate

SetOnDeviceID sets the "on_device" edge to the Device entity by ID.

func (*IPAddressCreate) SetSubnetMask added in v0.2.0

func (iac *IPAddressCreate) SetSubnetMask(s string) *IPAddressCreate

SetSubnetMask sets the "subnet_mask" field.

type IPAddressCreateBulk added in v0.2.0

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

IPAddressCreateBulk is the builder for creating many IPAddress entities in bulk.

func (*IPAddressCreateBulk) Save added in v0.2.0

func (iacb *IPAddressCreateBulk) Save(ctx context.Context) ([]*IPAddress, error)

Save creates the IPAddress entities in the database.

func (*IPAddressCreateBulk) SaveX added in v0.2.0

func (iacb *IPAddressCreateBulk) SaveX(ctx context.Context) []*IPAddress

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

type IPAddressDelete added in v0.2.0

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

IPAddressDelete is the builder for deleting a IPAddress entity.

func (*IPAddressDelete) Exec added in v0.2.0

func (iad *IPAddressDelete) Exec(ctx context.Context) (int, error)

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

func (*IPAddressDelete) ExecX added in v0.2.0

func (iad *IPAddressDelete) ExecX(ctx context.Context) int

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

func (*IPAddressDelete) Where added in v0.2.0

Where adds a new predicate to the IPAddressDelete builder.

type IPAddressDeleteOne added in v0.2.0

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

IPAddressDeleteOne is the builder for deleting a single IPAddress entity.

func (*IPAddressDeleteOne) Exec added in v0.2.0

func (iado *IPAddressDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*IPAddressDeleteOne) ExecX added in v0.2.0

func (iado *IPAddressDeleteOne) ExecX(ctx context.Context)

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

type IPAddressEdges added in v0.2.0

type IPAddressEdges struct {
	// OnDevice holds the value of the on_device edge.
	OnDevice *Device `json:"on_device,omitempty"`
	// Interfaces holds the value of the interfaces edge.
	Interfaces []*NetInterface `json:"interfaces,omitempty"`
	// PoInterfaces holds the value of the po_interfaces edge.
	PoInterfaces []*PortChannelInterface `json:"po_interfaces,omitempty"`
	// contains filtered or unexported fields
}

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

func (IPAddressEdges) InterfacesOrErr added in v0.2.0

func (e IPAddressEdges) InterfacesOrErr() ([]*NetInterface, error)

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

func (IPAddressEdges) OnDeviceOrErr added in v0.2.0

func (e IPAddressEdges) OnDeviceOrErr() (*Device, error)

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

func (IPAddressEdges) PoInterfacesOrErr added in v0.2.0

func (e IPAddressEdges) PoInterfacesOrErr() ([]*PortChannelInterface, error)

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

type IPAddressGroupBy added in v0.2.0

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

IPAddressGroupBy is the group-by builder for IPAddress entities.

func (*IPAddressGroupBy) Aggregate added in v0.2.0

func (iagb *IPAddressGroupBy) Aggregate(fns ...AggregateFunc) *IPAddressGroupBy

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

func (*IPAddressGroupBy) Bool added in v0.2.0

func (iagb *IPAddressGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*IPAddressGroupBy) BoolX added in v0.2.0

func (iagb *IPAddressGroupBy) BoolX(ctx context.Context) bool

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

func (*IPAddressGroupBy) Bools added in v0.2.0

func (iagb *IPAddressGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*IPAddressGroupBy) BoolsX added in v0.2.0

func (iagb *IPAddressGroupBy) BoolsX(ctx context.Context) []bool

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

func (*IPAddressGroupBy) Float64 added in v0.2.0

func (iagb *IPAddressGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*IPAddressGroupBy) Float64X added in v0.2.0

func (iagb *IPAddressGroupBy) Float64X(ctx context.Context) float64

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

func (*IPAddressGroupBy) Float64s added in v0.2.0

func (iagb *IPAddressGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*IPAddressGroupBy) Float64sX added in v0.2.0

func (iagb *IPAddressGroupBy) Float64sX(ctx context.Context) []float64

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

func (*IPAddressGroupBy) Int added in v0.2.0

func (iagb *IPAddressGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*IPAddressGroupBy) IntX added in v0.2.0

func (iagb *IPAddressGroupBy) IntX(ctx context.Context) int

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

func (*IPAddressGroupBy) Ints added in v0.2.0

func (iagb *IPAddressGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*IPAddressGroupBy) IntsX added in v0.2.0

func (iagb *IPAddressGroupBy) IntsX(ctx context.Context) []int

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

func (*IPAddressGroupBy) Scan added in v0.2.0

func (iagb *IPAddressGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*IPAddressGroupBy) ScanX added in v0.2.0

func (iagb *IPAddressGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*IPAddressGroupBy) String added in v0.2.0

func (iagb *IPAddressGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*IPAddressGroupBy) StringX added in v0.2.0

func (iagb *IPAddressGroupBy) StringX(ctx context.Context) string

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

func (*IPAddressGroupBy) Strings added in v0.2.0

func (iagb *IPAddressGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*IPAddressGroupBy) StringsX added in v0.2.0

func (iagb *IPAddressGroupBy) StringsX(ctx context.Context) []string

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

type IPAddressMutation added in v0.2.0

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

IPAddressMutation represents an operation that mutates the IPAddress nodes in the graph.

func (*IPAddressMutation) AddField added in v0.2.0

func (m *IPAddressMutation) 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 (*IPAddressMutation) AddInterfaceIDs added in v0.2.0

func (m *IPAddressMutation) AddInterfaceIDs(ids ...int)

AddInterfaceIDs adds the "interfaces" edge to the NetInterface entity by ids.

func (*IPAddressMutation) AddPoInterfaceIDs added in v0.2.0

func (m *IPAddressMutation) AddPoInterfaceIDs(ids ...int)

AddPoInterfaceIDs adds the "po_interfaces" edge to the PortChannelInterface entity by ids.

func (*IPAddressMutation) AddedEdges added in v0.2.0

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

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

func (*IPAddressMutation) AddedField added in v0.2.0

func (m *IPAddressMutation) 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 (*IPAddressMutation) AddedFields added in v0.2.0

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

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

func (*IPAddressMutation) AddedIDs added in v0.2.0

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

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

func (*IPAddressMutation) ClearEdge added in v0.2.0

func (m *IPAddressMutation) 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 (*IPAddressMutation) ClearField added in v0.2.0

func (m *IPAddressMutation) 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 (*IPAddressMutation) ClearInterfaces added in v0.2.0

func (m *IPAddressMutation) ClearInterfaces()

ClearInterfaces clears the "interfaces" edge to the NetInterface entity.

func (*IPAddressMutation) ClearOnDevice added in v0.2.0

func (m *IPAddressMutation) ClearOnDevice()

ClearOnDevice clears the "on_device" edge to the Device entity.

func (*IPAddressMutation) ClearPoInterfaces added in v0.2.0

func (m *IPAddressMutation) ClearPoInterfaces()

ClearPoInterfaces clears the "po_interfaces" edge to the PortChannelInterface entity.

func (*IPAddressMutation) ClearedEdges added in v0.2.0

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

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

func (*IPAddressMutation) ClearedFields added in v0.2.0

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

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

func (IPAddressMutation) Client added in v0.2.0

func (m IPAddressMutation) 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 (*IPAddressMutation) EdgeCleared added in v0.2.0

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

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

func (*IPAddressMutation) Field added in v0.2.0

func (m *IPAddressMutation) 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 (*IPAddressMutation) FieldCleared added in v0.2.0

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

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

func (*IPAddressMutation) Fields added in v0.2.0

func (m *IPAddressMutation) 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 (*IPAddressMutation) ID added in v0.2.0

func (m *IPAddressMutation) 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.

func (*IPAddressMutation) IPAddress added in v0.2.0

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

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

func (*IPAddressMutation) InterfacesCleared added in v0.2.0

func (m *IPAddressMutation) InterfacesCleared() bool

InterfacesCleared reports if the "interfaces" edge to the NetInterface entity was cleared.

func (*IPAddressMutation) InterfacesIDs added in v0.2.0

func (m *IPAddressMutation) InterfacesIDs() (ids []int)

InterfacesIDs returns the "interfaces" edge IDs in the mutation.

func (*IPAddressMutation) OldField added in v0.2.0

func (m *IPAddressMutation) 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 (*IPAddressMutation) OldIPAddress added in v0.2.0

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

OldIPAddress returns the old "ip_address" field's value of the IPAddress entity. If the IPAddress 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 (*IPAddressMutation) OldSubnetMask added in v0.2.0

func (m *IPAddressMutation) OldSubnetMask(ctx context.Context) (v string, err error)

OldSubnetMask returns the old "subnet_mask" field's value of the IPAddress entity. If the IPAddress 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 (*IPAddressMutation) OnDeviceCleared added in v0.2.0

func (m *IPAddressMutation) OnDeviceCleared() bool

OnDeviceCleared reports if the "on_device" edge to the Device entity was cleared.

func (*IPAddressMutation) OnDeviceID added in v0.2.0

func (m *IPAddressMutation) OnDeviceID() (id int, exists bool)

OnDeviceID returns the "on_device" edge ID in the mutation.

func (*IPAddressMutation) OnDeviceIDs added in v0.2.0

func (m *IPAddressMutation) OnDeviceIDs() (ids []int)

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

func (*IPAddressMutation) Op added in v0.2.0

func (m *IPAddressMutation) Op() Op

Op returns the operation name.

func (*IPAddressMutation) PoInterfacesCleared added in v0.2.0

func (m *IPAddressMutation) PoInterfacesCleared() bool

PoInterfacesCleared reports if the "po_interfaces" edge to the PortChannelInterface entity was cleared.

func (*IPAddressMutation) PoInterfacesIDs added in v0.2.0

func (m *IPAddressMutation) PoInterfacesIDs() (ids []int)

PoInterfacesIDs returns the "po_interfaces" edge IDs in the mutation.

func (*IPAddressMutation) RemoveInterfaceIDs added in v0.2.0

func (m *IPAddressMutation) RemoveInterfaceIDs(ids ...int)

RemoveInterfaceIDs removes the "interfaces" edge to the NetInterface entity by IDs.

func (*IPAddressMutation) RemovePoInterfaceIDs added in v0.2.0

func (m *IPAddressMutation) RemovePoInterfaceIDs(ids ...int)

RemovePoInterfaceIDs removes the "po_interfaces" edge to the PortChannelInterface entity by IDs.

func (*IPAddressMutation) RemovedEdges added in v0.2.0

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

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

func (*IPAddressMutation) RemovedIDs added in v0.2.0

func (m *IPAddressMutation) 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 (*IPAddressMutation) RemovedInterfacesIDs added in v0.2.0

func (m *IPAddressMutation) RemovedInterfacesIDs() (ids []int)

RemovedInterfaces returns the removed IDs of the "interfaces" edge to the NetInterface entity.

func (*IPAddressMutation) RemovedPoInterfacesIDs added in v0.2.0

func (m *IPAddressMutation) RemovedPoInterfacesIDs() (ids []int)

RemovedPoInterfaces returns the removed IDs of the "po_interfaces" edge to the PortChannelInterface entity.

func (*IPAddressMutation) ResetEdge added in v0.2.0

func (m *IPAddressMutation) 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 (*IPAddressMutation) ResetField added in v0.2.0

func (m *IPAddressMutation) 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 (*IPAddressMutation) ResetIPAddress added in v0.2.0

func (m *IPAddressMutation) ResetIPAddress()

ResetIPAddress resets all changes to the "ip_address" field.

func (*IPAddressMutation) ResetInterfaces added in v0.2.0

func (m *IPAddressMutation) ResetInterfaces()

ResetInterfaces resets all changes to the "interfaces" edge.

func (*IPAddressMutation) ResetOnDevice added in v0.2.0

func (m *IPAddressMutation) ResetOnDevice()

ResetOnDevice resets all changes to the "on_device" edge.

func (*IPAddressMutation) ResetPoInterfaces added in v0.2.0

func (m *IPAddressMutation) ResetPoInterfaces()

ResetPoInterfaces resets all changes to the "po_interfaces" edge.

func (*IPAddressMutation) ResetSubnetMask added in v0.2.0

func (m *IPAddressMutation) ResetSubnetMask()

ResetSubnetMask resets all changes to the "subnet_mask" field.

func (*IPAddressMutation) SetField added in v0.2.0

func (m *IPAddressMutation) 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 (*IPAddressMutation) SetIPAddress added in v0.2.0

func (m *IPAddressMutation) SetIPAddress(s string)

SetIPAddress sets the "ip_address" field.

func (*IPAddressMutation) SetOnDeviceID added in v0.2.0

func (m *IPAddressMutation) SetOnDeviceID(id int)

SetOnDeviceID sets the "on_device" edge to the Device entity by id.

func (*IPAddressMutation) SetSubnetMask added in v0.2.0

func (m *IPAddressMutation) SetSubnetMask(s string)

SetSubnetMask sets the "subnet_mask" field.

func (*IPAddressMutation) SubnetMask added in v0.2.0

func (m *IPAddressMutation) SubnetMask() (r string, exists bool)

SubnetMask returns the value of the "subnet_mask" field in the mutation.

func (IPAddressMutation) Tx added in v0.2.0

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

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

func (*IPAddressMutation) Type added in v0.2.0

func (m *IPAddressMutation) Type() string

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

type IPAddressQuery added in v0.2.0

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

IPAddressQuery is the builder for querying IPAddress entities.

func (*IPAddressQuery) All added in v0.2.0

func (iaq *IPAddressQuery) All(ctx context.Context) ([]*IPAddress, error)

All executes the query and returns a list of IPAddresses.

func (*IPAddressQuery) AllX added in v0.2.0

func (iaq *IPAddressQuery) AllX(ctx context.Context) []*IPAddress

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

func (*IPAddressQuery) Clone added in v0.2.0

func (iaq *IPAddressQuery) Clone() *IPAddressQuery

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

func (*IPAddressQuery) Count added in v0.2.0

func (iaq *IPAddressQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*IPAddressQuery) CountX added in v0.2.0

func (iaq *IPAddressQuery) CountX(ctx context.Context) int

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

func (*IPAddressQuery) Exist added in v0.2.0

func (iaq *IPAddressQuery) Exist(ctx context.Context) (bool, error)

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

func (*IPAddressQuery) ExistX added in v0.2.0

func (iaq *IPAddressQuery) ExistX(ctx context.Context) bool

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

func (*IPAddressQuery) First added in v0.2.0

func (iaq *IPAddressQuery) First(ctx context.Context) (*IPAddress, error)

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

func (*IPAddressQuery) FirstID added in v0.2.0

func (iaq *IPAddressQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*IPAddressQuery) FirstIDX added in v0.2.0

func (iaq *IPAddressQuery) FirstIDX(ctx context.Context) int

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

func (*IPAddressQuery) FirstX added in v0.2.0

func (iaq *IPAddressQuery) FirstX(ctx context.Context) *IPAddress

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

func (*IPAddressQuery) GroupBy added in v0.2.0

func (iaq *IPAddressQuery) GroupBy(field string, fields ...string) *IPAddressGroupBy

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

Example:

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

client.IPAddress.Query().
	GroupBy(ipaddress.FieldIPAddress).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*IPAddressQuery) IDs added in v0.2.0

func (iaq *IPAddressQuery) IDs(ctx context.Context) ([]int, error)

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

func (*IPAddressQuery) IDsX added in v0.2.0

func (iaq *IPAddressQuery) IDsX(ctx context.Context) []int

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

func (*IPAddressQuery) Limit added in v0.2.0

func (iaq *IPAddressQuery) Limit(limit int) *IPAddressQuery

Limit adds a limit step to the query.

func (*IPAddressQuery) Offset added in v0.2.0

func (iaq *IPAddressQuery) Offset(offset int) *IPAddressQuery

Offset adds an offset step to the query.

func (*IPAddressQuery) Only added in v0.2.0

func (iaq *IPAddressQuery) Only(ctx context.Context) (*IPAddress, error)

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

func (*IPAddressQuery) OnlyID added in v0.2.0

func (iaq *IPAddressQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*IPAddressQuery) OnlyIDX added in v0.2.0

func (iaq *IPAddressQuery) OnlyIDX(ctx context.Context) int

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

func (*IPAddressQuery) OnlyX added in v0.2.0

func (iaq *IPAddressQuery) OnlyX(ctx context.Context) *IPAddress

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

func (*IPAddressQuery) Order added in v0.2.0

func (iaq *IPAddressQuery) Order(o ...OrderFunc) *IPAddressQuery

Order adds an order step to the query.

func (*IPAddressQuery) QueryInterfaces added in v0.2.0

func (iaq *IPAddressQuery) QueryInterfaces() *NetInterfaceQuery

QueryInterfaces chains the current query on the "interfaces" edge.

func (*IPAddressQuery) QueryOnDevice added in v0.2.0

func (iaq *IPAddressQuery) QueryOnDevice() *DeviceQuery

QueryOnDevice chains the current query on the "on_device" edge.

func (*IPAddressQuery) QueryPoInterfaces added in v0.2.0

func (iaq *IPAddressQuery) QueryPoInterfaces() *PortChannelInterfaceQuery

QueryPoInterfaces chains the current query on the "po_interfaces" edge.

func (*IPAddressQuery) Select added in v0.2.0

func (iaq *IPAddressQuery) Select(field string, fields ...string) *IPAddressSelect

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

Example:

var v []struct {
	IPAddress string `json:"ip_address,omitempty"`
}

client.IPAddress.Query().
	Select(ipaddress.FieldIPAddress).
	Scan(ctx, &v)

func (*IPAddressQuery) Unique added in v0.2.0

func (iaq *IPAddressQuery) Unique(unique bool) *IPAddressQuery

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 (*IPAddressQuery) Where added in v0.2.0

func (iaq *IPAddressQuery) Where(ps ...predicate.IPAddress) *IPAddressQuery

Where adds a new predicate for the IPAddressQuery builder.

func (*IPAddressQuery) WithInterfaces added in v0.2.0

func (iaq *IPAddressQuery) WithInterfaces(opts ...func(*NetInterfaceQuery)) *IPAddressQuery

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

func (*IPAddressQuery) WithOnDevice added in v0.2.0

func (iaq *IPAddressQuery) WithOnDevice(opts ...func(*DeviceQuery)) *IPAddressQuery

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

func (*IPAddressQuery) WithPoInterfaces added in v0.2.0

func (iaq *IPAddressQuery) WithPoInterfaces(opts ...func(*PortChannelInterfaceQuery)) *IPAddressQuery

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

type IPAddressSelect added in v0.2.0

type IPAddressSelect struct {
	*IPAddressQuery
	// contains filtered or unexported fields
}

IPAddressSelect is the builder for selecting fields of IPAddress entities.

func (*IPAddressSelect) Bool added in v0.2.0

func (ias *IPAddressSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*IPAddressSelect) BoolX added in v0.2.0

func (ias *IPAddressSelect) BoolX(ctx context.Context) bool

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

func (*IPAddressSelect) Bools added in v0.2.0

func (ias *IPAddressSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*IPAddressSelect) BoolsX added in v0.2.0

func (ias *IPAddressSelect) BoolsX(ctx context.Context) []bool

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

func (*IPAddressSelect) Float64 added in v0.2.0

func (ias *IPAddressSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*IPAddressSelect) Float64X added in v0.2.0

func (ias *IPAddressSelect) Float64X(ctx context.Context) float64

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

func (*IPAddressSelect) Float64s added in v0.2.0

func (ias *IPAddressSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*IPAddressSelect) Float64sX added in v0.2.0

func (ias *IPAddressSelect) Float64sX(ctx context.Context) []float64

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

func (*IPAddressSelect) Int added in v0.2.0

func (ias *IPAddressSelect) Int(ctx context.Context) (_ int, err error)

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

func (*IPAddressSelect) IntX added in v0.2.0

func (ias *IPAddressSelect) IntX(ctx context.Context) int

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

func (*IPAddressSelect) Ints added in v0.2.0

func (ias *IPAddressSelect) Ints(ctx context.Context) ([]int, error)

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

func (*IPAddressSelect) IntsX added in v0.2.0

func (ias *IPAddressSelect) IntsX(ctx context.Context) []int

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

func (*IPAddressSelect) Scan added in v0.2.0

func (ias *IPAddressSelect) Scan(ctx context.Context, v interface{}) error

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

func (*IPAddressSelect) ScanX added in v0.2.0

func (ias *IPAddressSelect) ScanX(ctx context.Context, v interface{})

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

func (*IPAddressSelect) String added in v0.2.0

func (ias *IPAddressSelect) String(ctx context.Context) (_ string, err error)

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

func (*IPAddressSelect) StringX added in v0.2.0

func (ias *IPAddressSelect) StringX(ctx context.Context) string

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

func (*IPAddressSelect) Strings added in v0.2.0

func (ias *IPAddressSelect) Strings(ctx context.Context) ([]string, error)

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

func (*IPAddressSelect) StringsX added in v0.2.0

func (ias *IPAddressSelect) StringsX(ctx context.Context) []string

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

type IPAddressUpdate added in v0.2.0

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

IPAddressUpdate is the builder for updating IPAddress entities.

func (*IPAddressUpdate) AddInterfaceIDs added in v0.2.0

func (iau *IPAddressUpdate) AddInterfaceIDs(ids ...int) *IPAddressUpdate

AddInterfaceIDs adds the "interfaces" edge to the NetInterface entity by IDs.

func (*IPAddressUpdate) AddInterfaces added in v0.2.0

func (iau *IPAddressUpdate) AddInterfaces(n ...*NetInterface) *IPAddressUpdate

AddInterfaces adds the "interfaces" edges to the NetInterface entity.

func (*IPAddressUpdate) AddPoInterfaceIDs added in v0.2.0

func (iau *IPAddressUpdate) AddPoInterfaceIDs(ids ...int) *IPAddressUpdate

AddPoInterfaceIDs adds the "po_interfaces" edge to the PortChannelInterface entity by IDs.

func (*IPAddressUpdate) AddPoInterfaces added in v0.2.0

func (iau *IPAddressUpdate) AddPoInterfaces(p ...*PortChannelInterface) *IPAddressUpdate

AddPoInterfaces adds the "po_interfaces" edges to the PortChannelInterface entity.

func (*IPAddressUpdate) ClearInterfaces added in v0.2.0

func (iau *IPAddressUpdate) ClearInterfaces() *IPAddressUpdate

ClearInterfaces clears all "interfaces" edges to the NetInterface entity.

func (*IPAddressUpdate) ClearOnDevice added in v0.2.0

func (iau *IPAddressUpdate) ClearOnDevice() *IPAddressUpdate

ClearOnDevice clears the "on_device" edge to the Device entity.

func (*IPAddressUpdate) ClearPoInterfaces added in v0.2.0

func (iau *IPAddressUpdate) ClearPoInterfaces() *IPAddressUpdate

ClearPoInterfaces clears all "po_interfaces" edges to the PortChannelInterface entity.

func (*IPAddressUpdate) Exec added in v0.2.0

func (iau *IPAddressUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*IPAddressUpdate) ExecX added in v0.2.0

func (iau *IPAddressUpdate) ExecX(ctx context.Context)

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

func (*IPAddressUpdate) Mutation added in v0.2.0

func (iau *IPAddressUpdate) Mutation() *IPAddressMutation

Mutation returns the IPAddressMutation object of the builder.

func (*IPAddressUpdate) RemoveInterfaceIDs added in v0.2.0

func (iau *IPAddressUpdate) RemoveInterfaceIDs(ids ...int) *IPAddressUpdate

RemoveInterfaceIDs removes the "interfaces" edge to NetInterface entities by IDs.

func (*IPAddressUpdate) RemoveInterfaces added in v0.2.0

func (iau *IPAddressUpdate) RemoveInterfaces(n ...*NetInterface) *IPAddressUpdate

RemoveInterfaces removes "interfaces" edges to NetInterface entities.

func (*IPAddressUpdate) RemovePoInterfaceIDs added in v0.2.0

func (iau *IPAddressUpdate) RemovePoInterfaceIDs(ids ...int) *IPAddressUpdate

RemovePoInterfaceIDs removes the "po_interfaces" edge to PortChannelInterface entities by IDs.

func (*IPAddressUpdate) RemovePoInterfaces added in v0.2.0

func (iau *IPAddressUpdate) RemovePoInterfaces(p ...*PortChannelInterface) *IPAddressUpdate

RemovePoInterfaces removes "po_interfaces" edges to PortChannelInterface entities.

func (*IPAddressUpdate) Save added in v0.2.0

func (iau *IPAddressUpdate) Save(ctx context.Context) (int, error)

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

func (*IPAddressUpdate) SaveX added in v0.2.0

func (iau *IPAddressUpdate) SaveX(ctx context.Context) int

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

func (*IPAddressUpdate) SetIPAddress added in v0.2.0

func (iau *IPAddressUpdate) SetIPAddress(s string) *IPAddressUpdate

SetIPAddress sets the "ip_address" field.

func (*IPAddressUpdate) SetNillableOnDeviceID added in v0.2.0

func (iau *IPAddressUpdate) SetNillableOnDeviceID(id *int) *IPAddressUpdate

SetNillableOnDeviceID sets the "on_device" edge to the Device entity by ID if the given value is not nil.

func (*IPAddressUpdate) SetOnDevice added in v0.2.0

func (iau *IPAddressUpdate) SetOnDevice(d *Device) *IPAddressUpdate

SetOnDevice sets the "on_device" edge to the Device entity.

func (*IPAddressUpdate) SetOnDeviceID added in v0.2.0

func (iau *IPAddressUpdate) SetOnDeviceID(id int) *IPAddressUpdate

SetOnDeviceID sets the "on_device" edge to the Device entity by ID.

func (*IPAddressUpdate) SetSubnetMask added in v0.2.0

func (iau *IPAddressUpdate) SetSubnetMask(s string) *IPAddressUpdate

SetSubnetMask sets the "subnet_mask" field.

func (*IPAddressUpdate) Where added in v0.2.0

Where adds a new predicate for the IPAddressUpdate builder.

type IPAddressUpdateOne added in v0.2.0

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

IPAddressUpdateOne is the builder for updating a single IPAddress entity.

func (*IPAddressUpdateOne) AddInterfaceIDs added in v0.2.0

func (iauo *IPAddressUpdateOne) AddInterfaceIDs(ids ...int) *IPAddressUpdateOne

AddInterfaceIDs adds the "interfaces" edge to the NetInterface entity by IDs.

func (*IPAddressUpdateOne) AddInterfaces added in v0.2.0

func (iauo *IPAddressUpdateOne) AddInterfaces(n ...*NetInterface) *IPAddressUpdateOne

AddInterfaces adds the "interfaces" edges to the NetInterface entity.

func (*IPAddressUpdateOne) AddPoInterfaceIDs added in v0.2.0

func (iauo *IPAddressUpdateOne) AddPoInterfaceIDs(ids ...int) *IPAddressUpdateOne

AddPoInterfaceIDs adds the "po_interfaces" edge to the PortChannelInterface entity by IDs.

func (*IPAddressUpdateOne) AddPoInterfaces added in v0.2.0

func (iauo *IPAddressUpdateOne) AddPoInterfaces(p ...*PortChannelInterface) *IPAddressUpdateOne

AddPoInterfaces adds the "po_interfaces" edges to the PortChannelInterface entity.

func (*IPAddressUpdateOne) ClearInterfaces added in v0.2.0

func (iauo *IPAddressUpdateOne) ClearInterfaces() *IPAddressUpdateOne

ClearInterfaces clears all "interfaces" edges to the NetInterface entity.

func (*IPAddressUpdateOne) ClearOnDevice added in v0.2.0

func (iauo *IPAddressUpdateOne) ClearOnDevice() *IPAddressUpdateOne

ClearOnDevice clears the "on_device" edge to the Device entity.

func (*IPAddressUpdateOne) ClearPoInterfaces added in v0.2.0

func (iauo *IPAddressUpdateOne) ClearPoInterfaces() *IPAddressUpdateOne

ClearPoInterfaces clears all "po_interfaces" edges to the PortChannelInterface entity.

func (*IPAddressUpdateOne) Exec added in v0.2.0

func (iauo *IPAddressUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*IPAddressUpdateOne) ExecX added in v0.2.0

func (iauo *IPAddressUpdateOne) ExecX(ctx context.Context)

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

func (*IPAddressUpdateOne) Mutation added in v0.2.0

func (iauo *IPAddressUpdateOne) Mutation() *IPAddressMutation

Mutation returns the IPAddressMutation object of the builder.

func (*IPAddressUpdateOne) RemoveInterfaceIDs added in v0.2.0

func (iauo *IPAddressUpdateOne) RemoveInterfaceIDs(ids ...int) *IPAddressUpdateOne

RemoveInterfaceIDs removes the "interfaces" edge to NetInterface entities by IDs.

func (*IPAddressUpdateOne) RemoveInterfaces added in v0.2.0

func (iauo *IPAddressUpdateOne) RemoveInterfaces(n ...*NetInterface) *IPAddressUpdateOne

RemoveInterfaces removes "interfaces" edges to NetInterface entities.

func (*IPAddressUpdateOne) RemovePoInterfaceIDs added in v0.2.0

func (iauo *IPAddressUpdateOne) RemovePoInterfaceIDs(ids ...int) *IPAddressUpdateOne

RemovePoInterfaceIDs removes the "po_interfaces" edge to PortChannelInterface entities by IDs.

func (*IPAddressUpdateOne) RemovePoInterfaces added in v0.2.0

func (iauo *IPAddressUpdateOne) RemovePoInterfaces(p ...*PortChannelInterface) *IPAddressUpdateOne

RemovePoInterfaces removes "po_interfaces" edges to PortChannelInterface entities.

func (*IPAddressUpdateOne) Save added in v0.2.0

func (iauo *IPAddressUpdateOne) Save(ctx context.Context) (*IPAddress, error)

Save executes the query and returns the updated IPAddress entity.

func (*IPAddressUpdateOne) SaveX added in v0.2.0

func (iauo *IPAddressUpdateOne) SaveX(ctx context.Context) *IPAddress

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

func (*IPAddressUpdateOne) Select added in v0.2.0

func (iauo *IPAddressUpdateOne) Select(field string, fields ...string) *IPAddressUpdateOne

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

func (*IPAddressUpdateOne) SetIPAddress added in v0.2.0

func (iauo *IPAddressUpdateOne) SetIPAddress(s string) *IPAddressUpdateOne

SetIPAddress sets the "ip_address" field.

func (*IPAddressUpdateOne) SetNillableOnDeviceID added in v0.2.0

func (iauo *IPAddressUpdateOne) SetNillableOnDeviceID(id *int) *IPAddressUpdateOne

SetNillableOnDeviceID sets the "on_device" edge to the Device entity by ID if the given value is not nil.

func (*IPAddressUpdateOne) SetOnDevice added in v0.2.0

func (iauo *IPAddressUpdateOne) SetOnDevice(d *Device) *IPAddressUpdateOne

SetOnDevice sets the "on_device" edge to the Device entity.

func (*IPAddressUpdateOne) SetOnDeviceID added in v0.2.0

func (iauo *IPAddressUpdateOne) SetOnDeviceID(id int) *IPAddressUpdateOne

SetOnDeviceID sets the "on_device" edge to the Device entity by ID.

func (*IPAddressUpdateOne) SetSubnetMask added in v0.2.0

func (iauo *IPAddressUpdateOne) SetSubnetMask(s string) *IPAddressUpdateOne

SetSubnetMask sets the "subnet_mask" field.

type IPAddresses added in v0.2.0

type IPAddresses []*IPAddress

IPAddresses is a parsable slice of IPAddress.

type IPStaticRoutingTable added in v0.2.0

type IPStaticRoutingTable struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// NetworkAddress holds the value of the "network_address" field.
	NetworkAddress string `json:"network_address,omitempty"`
	// SubnetMask holds the value of the "subnet_mask" field.
	SubnetMask string `json:"subnet_mask,omitempty"`
	// NextHop holds the value of the "next_hop" field.
	NextHop string `json:"next_hop,omitempty"`
	// BrdInterface holds the value of the "brd_interface" field.
	BrdInterface bool `json:"brd_interface,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the IPStaticRoutingTableQuery when eager-loading is set.
	Edges IPStaticRoutingTableEdges `json:"edges"`
	// contains filtered or unexported fields
}

IPStaticRoutingTable is the model entity for the IPStaticRoutingTable schema.

func (*IPStaticRoutingTable) QueryOnDevice added in v0.2.0

func (isrt *IPStaticRoutingTable) QueryOnDevice() *DeviceQuery

QueryOnDevice queries the "on_device" edge of the IPStaticRoutingTable entity.

func (*IPStaticRoutingTable) QueryOnInterface added in v0.2.0

func (isrt *IPStaticRoutingTable) QueryOnInterface() *NetInterfaceQuery

QueryOnInterface queries the "on_interface" edge of the IPStaticRoutingTable entity.

func (*IPStaticRoutingTable) String added in v0.2.0

func (isrt *IPStaticRoutingTable) String() string

String implements the fmt.Stringer.

func (*IPStaticRoutingTable) Unwrap added in v0.2.0

Unwrap unwraps the IPStaticRoutingTable 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 (*IPStaticRoutingTable) Update added in v0.2.0

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

type IPStaticRoutingTableClient added in v0.2.0

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

IPStaticRoutingTableClient is a client for the IPStaticRoutingTable schema.

func NewIPStaticRoutingTableClient added in v0.2.0

func NewIPStaticRoutingTableClient(c config) *IPStaticRoutingTableClient

NewIPStaticRoutingTableClient returns a client for the IPStaticRoutingTable from the given config.

func (*IPStaticRoutingTableClient) Create added in v0.2.0

Create returns a create builder for IPStaticRoutingTable.

func (*IPStaticRoutingTableClient) CreateBulk added in v0.2.0

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

func (*IPStaticRoutingTableClient) Delete added in v0.2.0

Delete returns a delete builder for IPStaticRoutingTable.

func (*IPStaticRoutingTableClient) DeleteOne added in v0.2.0

DeleteOne returns a delete builder for the given entity.

func (*IPStaticRoutingTableClient) DeleteOneID added in v0.2.0

DeleteOneID returns a delete builder for the given id.

func (*IPStaticRoutingTableClient) Get added in v0.2.0

Get returns a IPStaticRoutingTable entity by its id.

func (*IPStaticRoutingTableClient) GetX added in v0.2.0

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

func (*IPStaticRoutingTableClient) Hooks added in v0.2.0

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

Hooks returns the client hooks.

func (*IPStaticRoutingTableClient) Query added in v0.2.0

Query returns a query builder for IPStaticRoutingTable.

func (*IPStaticRoutingTableClient) QueryOnDevice added in v0.2.0

QueryOnDevice queries the on_device edge of a IPStaticRoutingTable.

func (*IPStaticRoutingTableClient) QueryOnInterface added in v0.2.0

QueryOnInterface queries the on_interface edge of a IPStaticRoutingTable.

func (*IPStaticRoutingTableClient) Update added in v0.2.0

Update returns an update builder for IPStaticRoutingTable.

func (*IPStaticRoutingTableClient) UpdateOne added in v0.2.0

UpdateOne returns an update builder for the given entity.

func (*IPStaticRoutingTableClient) UpdateOneID added in v0.2.0

UpdateOneID returns an update builder for the given id.

func (*IPStaticRoutingTableClient) Use added in v0.2.0

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

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

type IPStaticRoutingTableCreate added in v0.2.0

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

IPStaticRoutingTableCreate is the builder for creating a IPStaticRoutingTable entity.

func (*IPStaticRoutingTableCreate) Mutation added in v0.2.0

Mutation returns the IPStaticRoutingTableMutation object of the builder.

func (*IPStaticRoutingTableCreate) Save added in v0.2.0

Save creates the IPStaticRoutingTable in the database.

func (*IPStaticRoutingTableCreate) SaveX added in v0.2.0

SaveX calls Save and panics if Save returns an error.

func (*IPStaticRoutingTableCreate) SetBrdInterface added in v0.2.0

func (isrtc *IPStaticRoutingTableCreate) SetBrdInterface(b bool) *IPStaticRoutingTableCreate

SetBrdInterface sets the "brd_interface" field.

func (*IPStaticRoutingTableCreate) SetNetworkAddress added in v0.2.0

func (isrtc *IPStaticRoutingTableCreate) SetNetworkAddress(s string) *IPStaticRoutingTableCreate

SetNetworkAddress sets the "network_address" field.

func (*IPStaticRoutingTableCreate) SetNextHop added in v0.2.0

SetNextHop sets the "next_hop" field.

func (*IPStaticRoutingTableCreate) SetNillableBrdInterface added in v0.2.0

func (isrtc *IPStaticRoutingTableCreate) SetNillableBrdInterface(b *bool) *IPStaticRoutingTableCreate

SetNillableBrdInterface sets the "brd_interface" field if the given value is not nil.

func (*IPStaticRoutingTableCreate) SetNillableOnDeviceID added in v0.2.0

func (isrtc *IPStaticRoutingTableCreate) SetNillableOnDeviceID(id *int) *IPStaticRoutingTableCreate

SetNillableOnDeviceID sets the "on_device" edge to the Device entity by ID if the given value is not nil.

func (*IPStaticRoutingTableCreate) SetNillableOnInterfaceID added in v0.2.0

func (isrtc *IPStaticRoutingTableCreate) SetNillableOnInterfaceID(id *int) *IPStaticRoutingTableCreate

SetNillableOnInterfaceID sets the "on_interface" edge to the NetInterface entity by ID if the given value is not nil.

func (*IPStaticRoutingTableCreate) SetOnDevice added in v0.2.0

SetOnDevice sets the "on_device" edge to the Device entity.

func (*IPStaticRoutingTableCreate) SetOnDeviceID added in v0.2.0

func (isrtc *IPStaticRoutingTableCreate) SetOnDeviceID(id int) *IPStaticRoutingTableCreate

SetOnDeviceID sets the "on_device" edge to the Device entity by ID.

func (*IPStaticRoutingTableCreate) SetOnInterface added in v0.2.0

SetOnInterface sets the "on_interface" edge to the NetInterface entity.

func (*IPStaticRoutingTableCreate) SetOnInterfaceID added in v0.2.0

func (isrtc *IPStaticRoutingTableCreate) SetOnInterfaceID(id int) *IPStaticRoutingTableCreate

SetOnInterfaceID sets the "on_interface" edge to the NetInterface entity by ID.

func (*IPStaticRoutingTableCreate) SetSubnetMask added in v0.2.0

SetSubnetMask sets the "subnet_mask" field.

type IPStaticRoutingTableCreateBulk added in v0.2.0

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

IPStaticRoutingTableCreateBulk is the builder for creating many IPStaticRoutingTable entities in bulk.

func (*IPStaticRoutingTableCreateBulk) Save added in v0.2.0

Save creates the IPStaticRoutingTable entities in the database.

func (*IPStaticRoutingTableCreateBulk) SaveX added in v0.2.0

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

type IPStaticRoutingTableDelete added in v0.2.0

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

IPStaticRoutingTableDelete is the builder for deleting a IPStaticRoutingTable entity.

func (*IPStaticRoutingTableDelete) Exec added in v0.2.0

func (isrtd *IPStaticRoutingTableDelete) Exec(ctx context.Context) (int, error)

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

func (*IPStaticRoutingTableDelete) ExecX added in v0.2.0

func (isrtd *IPStaticRoutingTableDelete) ExecX(ctx context.Context) int

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

func (*IPStaticRoutingTableDelete) Where added in v0.2.0

Where adds a new predicate to the IPStaticRoutingTableDelete builder.

type IPStaticRoutingTableDeleteOne added in v0.2.0

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

IPStaticRoutingTableDeleteOne is the builder for deleting a single IPStaticRoutingTable entity.

func (*IPStaticRoutingTableDeleteOne) Exec added in v0.2.0

Exec executes the deletion query.

func (*IPStaticRoutingTableDeleteOne) ExecX added in v0.2.0

func (isrtdo *IPStaticRoutingTableDeleteOne) ExecX(ctx context.Context)

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

type IPStaticRoutingTableEdges added in v0.2.0

type IPStaticRoutingTableEdges struct {
	// OnDevice holds the value of the on_device edge.
	OnDevice *Device `json:"on_device,omitempty"`
	// OnInterface holds the value of the on_interface edge.
	OnInterface *NetInterface `json:"on_interface,omitempty"`
	// contains filtered or unexported fields
}

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

func (IPStaticRoutingTableEdges) OnDeviceOrErr added in v0.2.0

func (e IPStaticRoutingTableEdges) OnDeviceOrErr() (*Device, error)

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

func (IPStaticRoutingTableEdges) OnInterfaceOrErr added in v0.2.0

func (e IPStaticRoutingTableEdges) OnInterfaceOrErr() (*NetInterface, error)

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

type IPStaticRoutingTableGroupBy added in v0.2.0

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

IPStaticRoutingTableGroupBy is the group-by builder for IPStaticRoutingTable entities.

func (*IPStaticRoutingTableGroupBy) Aggregate added in v0.2.0

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

func (*IPStaticRoutingTableGroupBy) Bool added in v0.2.0

func (isrtgb *IPStaticRoutingTableGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*IPStaticRoutingTableGroupBy) BoolX added in v0.2.0

func (isrtgb *IPStaticRoutingTableGroupBy) BoolX(ctx context.Context) bool

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

func (*IPStaticRoutingTableGroupBy) Bools added in v0.2.0

func (isrtgb *IPStaticRoutingTableGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*IPStaticRoutingTableGroupBy) BoolsX added in v0.2.0

func (isrtgb *IPStaticRoutingTableGroupBy) BoolsX(ctx context.Context) []bool

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

func (*IPStaticRoutingTableGroupBy) Float64 added in v0.2.0

func (isrtgb *IPStaticRoutingTableGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*IPStaticRoutingTableGroupBy) Float64X added in v0.2.0

func (isrtgb *IPStaticRoutingTableGroupBy) Float64X(ctx context.Context) float64

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

func (*IPStaticRoutingTableGroupBy) Float64s added in v0.2.0

func (isrtgb *IPStaticRoutingTableGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*IPStaticRoutingTableGroupBy) Float64sX added in v0.2.0

func (isrtgb *IPStaticRoutingTableGroupBy) Float64sX(ctx context.Context) []float64

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

func (*IPStaticRoutingTableGroupBy) Int added in v0.2.0

func (isrtgb *IPStaticRoutingTableGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*IPStaticRoutingTableGroupBy) IntX added in v0.2.0

func (isrtgb *IPStaticRoutingTableGroupBy) IntX(ctx context.Context) int

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

func (*IPStaticRoutingTableGroupBy) Ints added in v0.2.0

func (isrtgb *IPStaticRoutingTableGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*IPStaticRoutingTableGroupBy) IntsX added in v0.2.0

func (isrtgb *IPStaticRoutingTableGroupBy) IntsX(ctx context.Context) []int

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

func (*IPStaticRoutingTableGroupBy) Scan added in v0.2.0

func (isrtgb *IPStaticRoutingTableGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*IPStaticRoutingTableGroupBy) ScanX added in v0.2.0

func (isrtgb *IPStaticRoutingTableGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*IPStaticRoutingTableGroupBy) String added in v0.2.0

func (isrtgb *IPStaticRoutingTableGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*IPStaticRoutingTableGroupBy) StringX added in v0.2.0

func (isrtgb *IPStaticRoutingTableGroupBy) StringX(ctx context.Context) string

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

func (*IPStaticRoutingTableGroupBy) Strings added in v0.2.0

func (isrtgb *IPStaticRoutingTableGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*IPStaticRoutingTableGroupBy) StringsX added in v0.2.0

func (isrtgb *IPStaticRoutingTableGroupBy) StringsX(ctx context.Context) []string

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

type IPStaticRoutingTableMutation added in v0.2.0

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

IPStaticRoutingTableMutation represents an operation that mutates the IPStaticRoutingTable nodes in the graph.

func (*IPStaticRoutingTableMutation) AddField added in v0.2.0

func (m *IPStaticRoutingTableMutation) 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 (*IPStaticRoutingTableMutation) AddedEdges added in v0.2.0

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

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

func (*IPStaticRoutingTableMutation) AddedField added in v0.2.0

func (m *IPStaticRoutingTableMutation) 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 (*IPStaticRoutingTableMutation) AddedFields added in v0.2.0

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

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

func (*IPStaticRoutingTableMutation) AddedIDs added in v0.2.0

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

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*IPStaticRoutingTableMutation) BrdInterface added in v0.2.0

func (m *IPStaticRoutingTableMutation) BrdInterface() (r bool, exists bool)

BrdInterface returns the value of the "brd_interface" field in the mutation.

func (*IPStaticRoutingTableMutation) ClearEdge added in v0.2.0

func (m *IPStaticRoutingTableMutation) 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 (*IPStaticRoutingTableMutation) ClearField added in v0.2.0

func (m *IPStaticRoutingTableMutation) 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 (*IPStaticRoutingTableMutation) ClearOnDevice added in v0.2.0

func (m *IPStaticRoutingTableMutation) ClearOnDevice()

ClearOnDevice clears the "on_device" edge to the Device entity.

func (*IPStaticRoutingTableMutation) ClearOnInterface added in v0.2.0

func (m *IPStaticRoutingTableMutation) ClearOnInterface()

ClearOnInterface clears the "on_interface" edge to the NetInterface entity.

func (*IPStaticRoutingTableMutation) ClearedEdges added in v0.2.0

func (m *IPStaticRoutingTableMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*IPStaticRoutingTableMutation) ClearedFields added in v0.2.0

func (m *IPStaticRoutingTableMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (IPStaticRoutingTableMutation) Client added in v0.2.0

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 (*IPStaticRoutingTableMutation) EdgeCleared added in v0.2.0

func (m *IPStaticRoutingTableMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*IPStaticRoutingTableMutation) Field added in v0.2.0

func (m *IPStaticRoutingTableMutation) 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 (*IPStaticRoutingTableMutation) FieldCleared added in v0.2.0

func (m *IPStaticRoutingTableMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*IPStaticRoutingTableMutation) Fields added in v0.2.0

func (m *IPStaticRoutingTableMutation) 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 (*IPStaticRoutingTableMutation) ID added in v0.2.0

func (m *IPStaticRoutingTableMutation) 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.

func (*IPStaticRoutingTableMutation) NetworkAddress added in v0.2.0

func (m *IPStaticRoutingTableMutation) NetworkAddress() (r string, exists bool)

NetworkAddress returns the value of the "network_address" field in the mutation.

func (*IPStaticRoutingTableMutation) NextHop added in v0.2.0

func (m *IPStaticRoutingTableMutation) NextHop() (r string, exists bool)

NextHop returns the value of the "next_hop" field in the mutation.

func (*IPStaticRoutingTableMutation) OldBrdInterface added in v0.2.0

func (m *IPStaticRoutingTableMutation) OldBrdInterface(ctx context.Context) (v bool, err error)

OldBrdInterface returns the old "brd_interface" field's value of the IPStaticRoutingTable entity. If the IPStaticRoutingTable 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 (*IPStaticRoutingTableMutation) OldField added in v0.2.0

func (m *IPStaticRoutingTableMutation) 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 (*IPStaticRoutingTableMutation) OldNetworkAddress added in v0.2.0

func (m *IPStaticRoutingTableMutation) OldNetworkAddress(ctx context.Context) (v string, err error)

OldNetworkAddress returns the old "network_address" field's value of the IPStaticRoutingTable entity. If the IPStaticRoutingTable 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 (*IPStaticRoutingTableMutation) OldNextHop added in v0.2.0

func (m *IPStaticRoutingTableMutation) OldNextHop(ctx context.Context) (v string, err error)

OldNextHop returns the old "next_hop" field's value of the IPStaticRoutingTable entity. If the IPStaticRoutingTable 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 (*IPStaticRoutingTableMutation) OldSubnetMask added in v0.2.0

func (m *IPStaticRoutingTableMutation) OldSubnetMask(ctx context.Context) (v string, err error)

OldSubnetMask returns the old "subnet_mask" field's value of the IPStaticRoutingTable entity. If the IPStaticRoutingTable 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 (*IPStaticRoutingTableMutation) OnDeviceCleared added in v0.2.0

func (m *IPStaticRoutingTableMutation) OnDeviceCleared() bool

OnDeviceCleared reports if the "on_device" edge to the Device entity was cleared.

func (*IPStaticRoutingTableMutation) OnDeviceID added in v0.2.0

func (m *IPStaticRoutingTableMutation) OnDeviceID() (id int, exists bool)

OnDeviceID returns the "on_device" edge ID in the mutation.

func (*IPStaticRoutingTableMutation) OnDeviceIDs added in v0.2.0

func (m *IPStaticRoutingTableMutation) OnDeviceIDs() (ids []int)

OnDeviceIDs returns the "on_device" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use OnDeviceID instead. It exists only for internal usage by the builders.

func (*IPStaticRoutingTableMutation) OnInterfaceCleared added in v0.2.0

func (m *IPStaticRoutingTableMutation) OnInterfaceCleared() bool

OnInterfaceCleared reports if the "on_interface" edge to the NetInterface entity was cleared.

func (*IPStaticRoutingTableMutation) OnInterfaceID added in v0.2.0

func (m *IPStaticRoutingTableMutation) OnInterfaceID() (id int, exists bool)

OnInterfaceID returns the "on_interface" edge ID in the mutation.

func (*IPStaticRoutingTableMutation) OnInterfaceIDs added in v0.2.0

func (m *IPStaticRoutingTableMutation) OnInterfaceIDs() (ids []int)

OnInterfaceIDs returns the "on_interface" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use OnInterfaceID instead. It exists only for internal usage by the builders.

func (*IPStaticRoutingTableMutation) Op added in v0.2.0

Op returns the operation name.

func (*IPStaticRoutingTableMutation) RemovedEdges added in v0.2.0

func (m *IPStaticRoutingTableMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*IPStaticRoutingTableMutation) RemovedIDs added in v0.2.0

func (m *IPStaticRoutingTableMutation) 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 (*IPStaticRoutingTableMutation) ResetBrdInterface added in v0.2.0

func (m *IPStaticRoutingTableMutation) ResetBrdInterface()

ResetBrdInterface resets all changes to the "brd_interface" field.

func (*IPStaticRoutingTableMutation) ResetEdge added in v0.2.0

func (m *IPStaticRoutingTableMutation) 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 (*IPStaticRoutingTableMutation) ResetField added in v0.2.0

func (m *IPStaticRoutingTableMutation) 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 (*IPStaticRoutingTableMutation) ResetNetworkAddress added in v0.2.0

func (m *IPStaticRoutingTableMutation) ResetNetworkAddress()

ResetNetworkAddress resets all changes to the "network_address" field.

func (*IPStaticRoutingTableMutation) ResetNextHop added in v0.2.0

func (m *IPStaticRoutingTableMutation) ResetNextHop()

ResetNextHop resets all changes to the "next_hop" field.

func (*IPStaticRoutingTableMutation) ResetOnDevice added in v0.2.0

func (m *IPStaticRoutingTableMutation) ResetOnDevice()

ResetOnDevice resets all changes to the "on_device" edge.

func (*IPStaticRoutingTableMutation) ResetOnInterface added in v0.2.0

func (m *IPStaticRoutingTableMutation) ResetOnInterface()

ResetOnInterface resets all changes to the "on_interface" edge.

func (*IPStaticRoutingTableMutation) ResetSubnetMask added in v0.2.0

func (m *IPStaticRoutingTableMutation) ResetSubnetMask()

ResetSubnetMask resets all changes to the "subnet_mask" field.

func (*IPStaticRoutingTableMutation) SetBrdInterface added in v0.2.0

func (m *IPStaticRoutingTableMutation) SetBrdInterface(b bool)

SetBrdInterface sets the "brd_interface" field.

func (*IPStaticRoutingTableMutation) SetField added in v0.2.0

func (m *IPStaticRoutingTableMutation) 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 (*IPStaticRoutingTableMutation) SetNetworkAddress added in v0.2.0

func (m *IPStaticRoutingTableMutation) SetNetworkAddress(s string)

SetNetworkAddress sets the "network_address" field.

func (*IPStaticRoutingTableMutation) SetNextHop added in v0.2.0

func (m *IPStaticRoutingTableMutation) SetNextHop(s string)

SetNextHop sets the "next_hop" field.

func (*IPStaticRoutingTableMutation) SetOnDeviceID added in v0.2.0

func (m *IPStaticRoutingTableMutation) SetOnDeviceID(id int)

SetOnDeviceID sets the "on_device" edge to the Device entity by id.

func (*IPStaticRoutingTableMutation) SetOnInterfaceID added in v0.2.0

func (m *IPStaticRoutingTableMutation) SetOnInterfaceID(id int)

SetOnInterfaceID sets the "on_interface" edge to the NetInterface entity by id.

func (*IPStaticRoutingTableMutation) SetSubnetMask added in v0.2.0

func (m *IPStaticRoutingTableMutation) SetSubnetMask(s string)

SetSubnetMask sets the "subnet_mask" field.

func (*IPStaticRoutingTableMutation) SubnetMask added in v0.2.0

func (m *IPStaticRoutingTableMutation) SubnetMask() (r string, exists bool)

SubnetMask returns the value of the "subnet_mask" field in the mutation.

func (IPStaticRoutingTableMutation) Tx added in v0.2.0

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*IPStaticRoutingTableMutation) Type added in v0.2.0

Type returns the node type of this mutation (IPStaticRoutingTable).

type IPStaticRoutingTableQuery added in v0.2.0

type IPStaticRoutingTableQuery struct {
	// contains filtered or unexported fields
}

IPStaticRoutingTableQuery is the builder for querying IPStaticRoutingTable entities.

func (*IPStaticRoutingTableQuery) All added in v0.2.0

All executes the query and returns a list of IPStaticRoutingTables.

func (*IPStaticRoutingTableQuery) AllX added in v0.2.0

AllX is like All, but panics if an error occurs.

func (*IPStaticRoutingTableQuery) Clone added in v0.2.0

Clone returns a duplicate of the IPStaticRoutingTableQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*IPStaticRoutingTableQuery) Count added in v0.2.0

func (isrtq *IPStaticRoutingTableQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*IPStaticRoutingTableQuery) CountX added in v0.2.0

func (isrtq *IPStaticRoutingTableQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*IPStaticRoutingTableQuery) Exist added in v0.2.0

func (isrtq *IPStaticRoutingTableQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*IPStaticRoutingTableQuery) ExistX added in v0.2.0

func (isrtq *IPStaticRoutingTableQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*IPStaticRoutingTableQuery) First added in v0.2.0

First returns the first IPStaticRoutingTable entity from the query. Returns a *NotFoundError when no IPStaticRoutingTable was found.

func (*IPStaticRoutingTableQuery) FirstID added in v0.2.0

func (isrtq *IPStaticRoutingTableQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first IPStaticRoutingTable ID from the query. Returns a *NotFoundError when no IPStaticRoutingTable ID was found.

func (*IPStaticRoutingTableQuery) FirstIDX added in v0.2.0

func (isrtq *IPStaticRoutingTableQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*IPStaticRoutingTableQuery) FirstX added in v0.2.0

FirstX is like First, but panics if an error occurs.

func (*IPStaticRoutingTableQuery) GroupBy added in v0.2.0

func (isrtq *IPStaticRoutingTableQuery) GroupBy(field string, fields ...string) *IPStaticRoutingTableGroupBy

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 {
	NetworkAddress string `json:"network_address,omitempty"`
	Count int `json:"count,omitempty"`
}

client.IPStaticRoutingTable.Query().
	GroupBy(ipstaticroutingtable.FieldNetworkAddress).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*IPStaticRoutingTableQuery) IDs added in v0.2.0

func (isrtq *IPStaticRoutingTableQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of IPStaticRoutingTable IDs.

func (*IPStaticRoutingTableQuery) IDsX added in v0.2.0

func (isrtq *IPStaticRoutingTableQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*IPStaticRoutingTableQuery) Limit added in v0.2.0

Limit adds a limit step to the query.

func (*IPStaticRoutingTableQuery) Offset added in v0.2.0

Offset adds an offset step to the query.

func (*IPStaticRoutingTableQuery) Only added in v0.2.0

Only returns a single IPStaticRoutingTable entity found by the query, ensuring it only returns one. Returns a *NotSingularError when exactly one IPStaticRoutingTable entity is not found. Returns a *NotFoundError when no IPStaticRoutingTable entities are found.

func (*IPStaticRoutingTableQuery) OnlyID added in v0.2.0

func (isrtq *IPStaticRoutingTableQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only IPStaticRoutingTable ID in the query. Returns a *NotSingularError when exactly one IPStaticRoutingTable ID is not found. Returns a *NotFoundError when no entities are found.

func (*IPStaticRoutingTableQuery) OnlyIDX added in v0.2.0

func (isrtq *IPStaticRoutingTableQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*IPStaticRoutingTableQuery) OnlyX added in v0.2.0

OnlyX is like Only, but panics if an error occurs.

func (*IPStaticRoutingTableQuery) Order added in v0.2.0

Order adds an order step to the query.

func (*IPStaticRoutingTableQuery) QueryOnDevice added in v0.2.0

func (isrtq *IPStaticRoutingTableQuery) QueryOnDevice() *DeviceQuery

QueryOnDevice chains the current query on the "on_device" edge.

func (*IPStaticRoutingTableQuery) QueryOnInterface added in v0.2.0

func (isrtq *IPStaticRoutingTableQuery) QueryOnInterface() *NetInterfaceQuery

QueryOnInterface chains the current query on the "on_interface" edge.

func (*IPStaticRoutingTableQuery) Select added in v0.2.0

func (isrtq *IPStaticRoutingTableQuery) Select(field string, fields ...string) *IPStaticRoutingTableSelect

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 {
	NetworkAddress string `json:"network_address,omitempty"`
}

client.IPStaticRoutingTable.Query().
	Select(ipstaticroutingtable.FieldNetworkAddress).
	Scan(ctx, &v)

func (*IPStaticRoutingTableQuery) Unique added in v0.2.0

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 (*IPStaticRoutingTableQuery) Where added in v0.2.0

Where adds a new predicate for the IPStaticRoutingTableQuery builder.

func (*IPStaticRoutingTableQuery) WithOnDevice added in v0.2.0

func (isrtq *IPStaticRoutingTableQuery) WithOnDevice(opts ...func(*DeviceQuery)) *IPStaticRoutingTableQuery

WithOnDevice tells the query-builder to eager-load the nodes that are connected to the "on_device" edge. The optional arguments are used to configure the query builder of the edge.

func (*IPStaticRoutingTableQuery) WithOnInterface added in v0.2.0

func (isrtq *IPStaticRoutingTableQuery) WithOnInterface(opts ...func(*NetInterfaceQuery)) *IPStaticRoutingTableQuery

WithOnInterface tells the query-builder to eager-load the nodes that are connected to the "on_interface" edge. The optional arguments are used to configure the query builder of the edge.

type IPStaticRoutingTableSelect added in v0.2.0

type IPStaticRoutingTableSelect struct {
	*IPStaticRoutingTableQuery
	// contains filtered or unexported fields
}

IPStaticRoutingTableSelect is the builder for selecting fields of IPStaticRoutingTable entities.

func (*IPStaticRoutingTableSelect) Bool added in v0.2.0

func (isrts *IPStaticRoutingTableSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*IPStaticRoutingTableSelect) BoolX added in v0.2.0

func (isrts *IPStaticRoutingTableSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*IPStaticRoutingTableSelect) Bools added in v0.2.0

func (isrts *IPStaticRoutingTableSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*IPStaticRoutingTableSelect) BoolsX added in v0.2.0

func (isrts *IPStaticRoutingTableSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*IPStaticRoutingTableSelect) Float64 added in v0.2.0

func (isrts *IPStaticRoutingTableSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*IPStaticRoutingTableSelect) Float64X added in v0.2.0

func (isrts *IPStaticRoutingTableSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*IPStaticRoutingTableSelect) Float64s added in v0.2.0

func (isrts *IPStaticRoutingTableSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*IPStaticRoutingTableSelect) Float64sX added in v0.2.0

func (isrts *IPStaticRoutingTableSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*IPStaticRoutingTableSelect) Int added in v0.2.0

func (isrts *IPStaticRoutingTableSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*IPStaticRoutingTableSelect) IntX added in v0.2.0

func (isrts *IPStaticRoutingTableSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*IPStaticRoutingTableSelect) Ints added in v0.2.0

func (isrts *IPStaticRoutingTableSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*IPStaticRoutingTableSelect) IntsX added in v0.2.0

func (isrts *IPStaticRoutingTableSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*IPStaticRoutingTableSelect) Scan added in v0.2.0

func (isrts *IPStaticRoutingTableSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*IPStaticRoutingTableSelect) ScanX added in v0.2.0

func (isrts *IPStaticRoutingTableSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*IPStaticRoutingTableSelect) String added in v0.2.0

func (isrts *IPStaticRoutingTableSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*IPStaticRoutingTableSelect) StringX added in v0.2.0

func (isrts *IPStaticRoutingTableSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*IPStaticRoutingTableSelect) Strings added in v0.2.0

func (isrts *IPStaticRoutingTableSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*IPStaticRoutingTableSelect) StringsX added in v0.2.0

func (isrts *IPStaticRoutingTableSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type IPStaticRoutingTableUpdate added in v0.2.0

type IPStaticRoutingTableUpdate struct {
	// contains filtered or unexported fields
}

IPStaticRoutingTableUpdate is the builder for updating IPStaticRoutingTable entities.

func (*IPStaticRoutingTableUpdate) ClearOnDevice added in v0.2.0

ClearOnDevice clears the "on_device" edge to the Device entity.

func (*IPStaticRoutingTableUpdate) ClearOnInterface added in v0.2.0

func (isrtu *IPStaticRoutingTableUpdate) ClearOnInterface() *IPStaticRoutingTableUpdate

ClearOnInterface clears the "on_interface" edge to the NetInterface entity.

func (*IPStaticRoutingTableUpdate) Exec added in v0.2.0

Exec executes the query.

func (*IPStaticRoutingTableUpdate) ExecX added in v0.2.0

func (isrtu *IPStaticRoutingTableUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*IPStaticRoutingTableUpdate) Mutation added in v0.2.0

Mutation returns the IPStaticRoutingTableMutation object of the builder.

func (*IPStaticRoutingTableUpdate) Save added in v0.2.0

func (isrtu *IPStaticRoutingTableUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*IPStaticRoutingTableUpdate) SaveX added in v0.2.0

func (isrtu *IPStaticRoutingTableUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*IPStaticRoutingTableUpdate) SetBrdInterface added in v0.2.0

func (isrtu *IPStaticRoutingTableUpdate) SetBrdInterface(b bool) *IPStaticRoutingTableUpdate

SetBrdInterface sets the "brd_interface" field.

func (*IPStaticRoutingTableUpdate) SetNetworkAddress added in v0.2.0

func (isrtu *IPStaticRoutingTableUpdate) SetNetworkAddress(s string) *IPStaticRoutingTableUpdate

SetNetworkAddress sets the "network_address" field.

func (*IPStaticRoutingTableUpdate) SetNextHop added in v0.2.0

SetNextHop sets the "next_hop" field.

func (*IPStaticRoutingTableUpdate) SetNillableBrdInterface added in v0.2.0

func (isrtu *IPStaticRoutingTableUpdate) SetNillableBrdInterface(b *bool) *IPStaticRoutingTableUpdate

SetNillableBrdInterface sets the "brd_interface" field if the given value is not nil.

func (*IPStaticRoutingTableUpdate) SetNillableOnDeviceID added in v0.2.0

func (isrtu *IPStaticRoutingTableUpdate) SetNillableOnDeviceID(id *int) *IPStaticRoutingTableUpdate

SetNillableOnDeviceID sets the "on_device" edge to the Device entity by ID if the given value is not nil.

func (*IPStaticRoutingTableUpdate) SetNillableOnInterfaceID added in v0.2.0

func (isrtu *IPStaticRoutingTableUpdate) SetNillableOnInterfaceID(id *int) *IPStaticRoutingTableUpdate

SetNillableOnInterfaceID sets the "on_interface" edge to the NetInterface entity by ID if the given value is not nil.

func (*IPStaticRoutingTableUpdate) SetOnDevice added in v0.2.0

SetOnDevice sets the "on_device" edge to the Device entity.

func (*IPStaticRoutingTableUpdate) SetOnDeviceID added in v0.2.0

func (isrtu *IPStaticRoutingTableUpdate) SetOnDeviceID(id int) *IPStaticRoutingTableUpdate

SetOnDeviceID sets the "on_device" edge to the Device entity by ID.

func (*IPStaticRoutingTableUpdate) SetOnInterface added in v0.2.0

SetOnInterface sets the "on_interface" edge to the NetInterface entity.

func (*IPStaticRoutingTableUpdate) SetOnInterfaceID added in v0.2.0

func (isrtu *IPStaticRoutingTableUpdate) SetOnInterfaceID(id int) *IPStaticRoutingTableUpdate

SetOnInterfaceID sets the "on_interface" edge to the NetInterface entity by ID.

func (*IPStaticRoutingTableUpdate) SetSubnetMask added in v0.2.0

SetSubnetMask sets the "subnet_mask" field.

func (*IPStaticRoutingTableUpdate) Where added in v0.2.0

Where adds a new predicate for the IPStaticRoutingTableUpdate builder.

type IPStaticRoutingTableUpdateOne added in v0.2.0

type IPStaticRoutingTableUpdateOne struct {
	// contains filtered or unexported fields
}

IPStaticRoutingTableUpdateOne is the builder for updating a single IPStaticRoutingTable entity.

func (*IPStaticRoutingTableUpdateOne) ClearOnDevice added in v0.2.0

ClearOnDevice clears the "on_device" edge to the Device entity.

func (*IPStaticRoutingTableUpdateOne) ClearOnInterface added in v0.2.0

ClearOnInterface clears the "on_interface" edge to the NetInterface entity.

func (*IPStaticRoutingTableUpdateOne) Exec added in v0.2.0

Exec executes the query on the entity.

func (*IPStaticRoutingTableUpdateOne) ExecX added in v0.2.0

func (isrtuo *IPStaticRoutingTableUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*IPStaticRoutingTableUpdateOne) Mutation added in v0.2.0

Mutation returns the IPStaticRoutingTableMutation object of the builder.

func (*IPStaticRoutingTableUpdateOne) Save added in v0.2.0

Save executes the query and returns the updated IPStaticRoutingTable entity.

func (*IPStaticRoutingTableUpdateOne) SaveX added in v0.2.0

SaveX is like Save, but panics if an error occurs.

func (*IPStaticRoutingTableUpdateOne) Select added in v0.2.0

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*IPStaticRoutingTableUpdateOne) SetBrdInterface added in v0.2.0

SetBrdInterface sets the "brd_interface" field.

func (*IPStaticRoutingTableUpdateOne) SetNetworkAddress added in v0.2.0

SetNetworkAddress sets the "network_address" field.

func (*IPStaticRoutingTableUpdateOne) SetNextHop added in v0.2.0

SetNextHop sets the "next_hop" field.

func (*IPStaticRoutingTableUpdateOne) SetNillableBrdInterface added in v0.2.0

func (isrtuo *IPStaticRoutingTableUpdateOne) SetNillableBrdInterface(b *bool) *IPStaticRoutingTableUpdateOne

SetNillableBrdInterface sets the "brd_interface" field if the given value is not nil.

func (*IPStaticRoutingTableUpdateOne) SetNillableOnDeviceID added in v0.2.0

func (isrtuo *IPStaticRoutingTableUpdateOne) SetNillableOnDeviceID(id *int) *IPStaticRoutingTableUpdateOne

SetNillableOnDeviceID sets the "on_device" edge to the Device entity by ID if the given value is not nil.

func (*IPStaticRoutingTableUpdateOne) SetNillableOnInterfaceID added in v0.2.0

func (isrtuo *IPStaticRoutingTableUpdateOne) SetNillableOnInterfaceID(id *int) *IPStaticRoutingTableUpdateOne

SetNillableOnInterfaceID sets the "on_interface" edge to the NetInterface entity by ID if the given value is not nil.

func (*IPStaticRoutingTableUpdateOne) SetOnDevice added in v0.2.0

SetOnDevice sets the "on_device" edge to the Device entity.

func (*IPStaticRoutingTableUpdateOne) SetOnDeviceID added in v0.2.0

SetOnDeviceID sets the "on_device" edge to the Device entity by ID.

func (*IPStaticRoutingTableUpdateOne) SetOnInterface added in v0.2.0

SetOnInterface sets the "on_interface" edge to the NetInterface entity.

func (*IPStaticRoutingTableUpdateOne) SetOnInterfaceID added in v0.2.0

func (isrtuo *IPStaticRoutingTableUpdateOne) SetOnInterfaceID(id int) *IPStaticRoutingTableUpdateOne

SetOnInterfaceID sets the "on_interface" edge to the NetInterface entity by ID.

func (*IPStaticRoutingTableUpdateOne) SetSubnetMask added in v0.2.0

SetSubnetMask sets the "subnet_mask" field.

type IPStaticRoutingTables added in v0.2.0

type IPStaticRoutingTables []*IPStaticRoutingTable

IPStaticRoutingTables is a parsable slice of IPStaticRoutingTable.

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 NetInterface

type NetInterface struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// InterfaceName holds the value of the "interface_name" field.
	InterfaceName string `json:"interface_name,omitempty"`
	// InterfaceShutdown holds the value of the "interface_shutdown" field.
	InterfaceShutdown bool `json:"interface_shutdown,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the NetInterfaceQuery when eager-loading is set.
	Edges NetInterfaceEdges `json:"edges"`
	// contains filtered or unexported fields
}

NetInterface is the model entity for the NetInterface schema.

func (*NetInterface) QueryHaveVlans

func (ni *NetInterface) QueryHaveVlans() *VlanQuery

QueryHaveVlans queries the "have_vlans" edge of the NetInterface entity.

func (*NetInterface) QueryIPStaticRouting added in v0.2.0

func (ni *NetInterface) QueryIPStaticRouting() *IPStaticRoutingTableQuery

QueryIPStaticRouting queries the "ip_static_routing" edge of the NetInterface entity.

func (*NetInterface) QueryMode

func (ni *NetInterface) QueryMode() *NetInterfaceModeQuery

QueryMode queries the "mode" edge of the NetInterface entity.

func (*NetInterface) QueryNativeOnVlan

func (ni *NetInterface) QueryNativeOnVlan() *VlanQuery

QueryNativeOnVlan queries the "native_on_vlan" edge of the NetInterface entity.

func (*NetInterface) QueryOnDevice

func (ni *NetInterface) QueryOnDevice() *DeviceQuery

QueryOnDevice queries the "on_device" edge of the NetInterface entity.

func (*NetInterface) QueryOnIPAddress added in v0.2.0

func (ni *NetInterface) QueryOnIPAddress() *IPAddressQuery

QueryOnIPAddress queries the "on_ip_address" edge of the NetInterface entity.

func (*NetInterface) QueryOnLayer added in v0.2.0

func (ni *NetInterface) QueryOnLayer() *NetInterfaceLayerQuery

QueryOnLayer queries the "on_layer" edge of the NetInterface entity.

func (*NetInterface) QueryOnPoInterface added in v0.2.0

func (ni *NetInterface) QueryOnPoInterface() *PortChannelInterfaceQuery

QueryOnPoInterface queries the "on_po_interface" edge of the NetInterface entity.

func (*NetInterface) String

func (ni *NetInterface) String() string

String implements the fmt.Stringer.

func (*NetInterface) Unwrap

func (ni *NetInterface) Unwrap() *NetInterface

Unwrap unwraps the NetInterface 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 (*NetInterface) Update

func (ni *NetInterface) Update() *NetInterfaceUpdateOne

Update returns a builder for updating this NetInterface. Note that you need to call NetInterface.Unwrap() before calling this method if this NetInterface was returned from a transaction, and the transaction was committed or rolled back.

type NetInterfaceClient

type NetInterfaceClient struct {
	// contains filtered or unexported fields
}

NetInterfaceClient is a client for the NetInterface schema.

func NewNetInterfaceClient

func NewNetInterfaceClient(c config) *NetInterfaceClient

NewNetInterfaceClient returns a client for the NetInterface from the given config.

func (*NetInterfaceClient) Create

Create returns a create builder for NetInterface.

func (*NetInterfaceClient) CreateBulk

func (c *NetInterfaceClient) CreateBulk(builders ...*NetInterfaceCreate) *NetInterfaceCreateBulk

CreateBulk returns a builder for creating a bulk of NetInterface entities.

func (*NetInterfaceClient) Delete

Delete returns a delete builder for NetInterface.

func (*NetInterfaceClient) DeleteOne

DeleteOne returns a delete builder for the given entity.

func (*NetInterfaceClient) DeleteOneID

func (c *NetInterfaceClient) DeleteOneID(id int) *NetInterfaceDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*NetInterfaceClient) Get

Get returns a NetInterface entity by its id.

func (*NetInterfaceClient) GetX

GetX is like Get, but panics if an error occurs.

func (*NetInterfaceClient) Hooks

func (c *NetInterfaceClient) Hooks() []Hook

Hooks returns the client hooks.

func (*NetInterfaceClient) Query

Query returns a query builder for NetInterface.

func (*NetInterfaceClient) QueryHaveVlans

func (c *NetInterfaceClient) QueryHaveVlans(ni *NetInterface) *VlanQuery

QueryHaveVlans queries the have_vlans edge of a NetInterface.

func (*NetInterfaceClient) QueryIPStaticRouting added in v0.2.0

func (c *NetInterfaceClient) QueryIPStaticRouting(ni *NetInterface) *IPStaticRoutingTableQuery

QueryIPStaticRouting queries the ip_static_routing edge of a NetInterface.

func (*NetInterfaceClient) QueryMode

QueryMode queries the mode edge of a NetInterface.

func (*NetInterfaceClient) QueryNativeOnVlan

func (c *NetInterfaceClient) QueryNativeOnVlan(ni *NetInterface) *VlanQuery

QueryNativeOnVlan queries the native_on_vlan edge of a NetInterface.

func (*NetInterfaceClient) QueryOnDevice

func (c *NetInterfaceClient) QueryOnDevice(ni *NetInterface) *DeviceQuery

QueryOnDevice queries the on_device edge of a NetInterface.

func (*NetInterfaceClient) QueryOnIPAddress added in v0.2.0

func (c *NetInterfaceClient) QueryOnIPAddress(ni *NetInterface) *IPAddressQuery

QueryOnIPAddress queries the on_ip_address edge of a NetInterface.

func (*NetInterfaceClient) QueryOnLayer added in v0.2.0

QueryOnLayer queries the on_layer edge of a NetInterface.

func (*NetInterfaceClient) QueryOnPoInterface added in v0.2.0

func (c *NetInterfaceClient) QueryOnPoInterface(ni *NetInterface) *PortChannelInterfaceQuery

QueryOnPoInterface queries the on_po_interface edge of a NetInterface.

func (*NetInterfaceClient) Update

Update returns an update builder for NetInterface.

func (*NetInterfaceClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*NetInterfaceClient) UpdateOneID

func (c *NetInterfaceClient) UpdateOneID(id int) *NetInterfaceUpdateOne

UpdateOneID returns an update builder for the given id.

func (*NetInterfaceClient) Use

func (c *NetInterfaceClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `netinterface.Hooks(f(g(h())))`.

type NetInterfaceCreate

type NetInterfaceCreate struct {
	// contains filtered or unexported fields
}

NetInterfaceCreate is the builder for creating a NetInterface entity.

func (*NetInterfaceCreate) AddHaveVlanIDs

func (nic *NetInterfaceCreate) AddHaveVlanIDs(ids ...int) *NetInterfaceCreate

AddHaveVlanIDs adds the "have_vlans" edge to the Vlan entity by IDs.

func (*NetInterfaceCreate) AddHaveVlans

func (nic *NetInterfaceCreate) AddHaveVlans(v ...*Vlan) *NetInterfaceCreate

AddHaveVlans adds the "have_vlans" edges to the Vlan entity.

func (*NetInterfaceCreate) AddIPStaticRouting added in v0.2.0

func (nic *NetInterfaceCreate) AddIPStaticRouting(i ...*IPStaticRoutingTable) *NetInterfaceCreate

AddIPStaticRouting adds the "ip_static_routing" edges to the IPStaticRoutingTable entity.

func (*NetInterfaceCreate) AddIPStaticRoutingIDs added in v0.2.0

func (nic *NetInterfaceCreate) AddIPStaticRoutingIDs(ids ...int) *NetInterfaceCreate

AddIPStaticRoutingIDs adds the "ip_static_routing" edge to the IPStaticRoutingTable entity by IDs.

func (*NetInterfaceCreate) Mutation

func (nic *NetInterfaceCreate) Mutation() *NetInterfaceMutation

Mutation returns the NetInterfaceMutation object of the builder.

func (*NetInterfaceCreate) Save

Save creates the NetInterface in the database.

func (*NetInterfaceCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*NetInterfaceCreate) SetInterfaceName

func (nic *NetInterfaceCreate) SetInterfaceName(s string) *NetInterfaceCreate

SetInterfaceName sets the "interface_name" field.

func (*NetInterfaceCreate) SetInterfaceShutdown

func (nic *NetInterfaceCreate) SetInterfaceShutdown(b bool) *NetInterfaceCreate

SetInterfaceShutdown sets the "interface_shutdown" field.

func (*NetInterfaceCreate) SetMode

SetMode sets the "mode" edge to the NetInterfaceMode entity.

func (*NetInterfaceCreate) SetModeID

func (nic *NetInterfaceCreate) SetModeID(id int) *NetInterfaceCreate

SetModeID sets the "mode" edge to the NetInterfaceMode entity by ID.

func (*NetInterfaceCreate) SetNativeOnVlan

func (nic *NetInterfaceCreate) SetNativeOnVlan(v *Vlan) *NetInterfaceCreate

SetNativeOnVlan sets the "native_on_vlan" edge to the Vlan entity.

func (*NetInterfaceCreate) SetNativeOnVlanID

func (nic *NetInterfaceCreate) SetNativeOnVlanID(id int) *NetInterfaceCreate

SetNativeOnVlanID sets the "native_on_vlan" edge to the Vlan entity by ID.

func (*NetInterfaceCreate) SetNillableInterfaceShutdown

func (nic *NetInterfaceCreate) SetNillableInterfaceShutdown(b *bool) *NetInterfaceCreate

SetNillableInterfaceShutdown sets the "interface_shutdown" field if the given value is not nil.

func (*NetInterfaceCreate) SetNillableModeID

func (nic *NetInterfaceCreate) SetNillableModeID(id *int) *NetInterfaceCreate

SetNillableModeID sets the "mode" edge to the NetInterfaceMode entity by ID if the given value is not nil.

func (*NetInterfaceCreate) SetNillableNativeOnVlanID

func (nic *NetInterfaceCreate) SetNillableNativeOnVlanID(id *int) *NetInterfaceCreate

SetNillableNativeOnVlanID sets the "native_on_vlan" edge to the Vlan entity by ID if the given value is not nil.

func (*NetInterfaceCreate) SetNillableOnDeviceID

func (nic *NetInterfaceCreate) SetNillableOnDeviceID(id *int) *NetInterfaceCreate

SetNillableOnDeviceID sets the "on_device" edge to the Device entity by ID if the given value is not nil.

func (*NetInterfaceCreate) SetNillableOnIPAddressID added in v0.2.0

func (nic *NetInterfaceCreate) SetNillableOnIPAddressID(id *int) *NetInterfaceCreate

SetNillableOnIPAddressID sets the "on_ip_address" edge to the IPAddress entity by ID if the given value is not nil.

func (*NetInterfaceCreate) SetNillableOnLayerID added in v0.2.0

func (nic *NetInterfaceCreate) SetNillableOnLayerID(id *int) *NetInterfaceCreate

SetNillableOnLayerID sets the "on_layer" edge to the NetInterfaceLayer entity by ID if the given value is not nil.

func (*NetInterfaceCreate) SetNillableOnPoInterfaceID added in v0.2.0

func (nic *NetInterfaceCreate) SetNillableOnPoInterfaceID(id *int) *NetInterfaceCreate

SetNillableOnPoInterfaceID sets the "on_po_interface" edge to the PortChannelInterface entity by ID if the given value is not nil.

func (*NetInterfaceCreate) SetOnDevice

func (nic *NetInterfaceCreate) SetOnDevice(d *Device) *NetInterfaceCreate

SetOnDevice sets the "on_device" edge to the Device entity.

func (*NetInterfaceCreate) SetOnDeviceID

func (nic *NetInterfaceCreate) SetOnDeviceID(id int) *NetInterfaceCreate

SetOnDeviceID sets the "on_device" edge to the Device entity by ID.

func (*NetInterfaceCreate) SetOnIPAddress added in v0.2.0

func (nic *NetInterfaceCreate) SetOnIPAddress(i *IPAddress) *NetInterfaceCreate

SetOnIPAddress sets the "on_ip_address" edge to the IPAddress entity.

func (*NetInterfaceCreate) SetOnIPAddressID added in v0.2.0

func (nic *NetInterfaceCreate) SetOnIPAddressID(id int) *NetInterfaceCreate

SetOnIPAddressID sets the "on_ip_address" edge to the IPAddress entity by ID.

func (*NetInterfaceCreate) SetOnLayer added in v0.2.0

SetOnLayer sets the "on_layer" edge to the NetInterfaceLayer entity.

func (*NetInterfaceCreate) SetOnLayerID added in v0.2.0

func (nic *NetInterfaceCreate) SetOnLayerID(id int) *NetInterfaceCreate

SetOnLayerID sets the "on_layer" edge to the NetInterfaceLayer entity by ID.

func (*NetInterfaceCreate) SetOnPoInterface added in v0.2.0

func (nic *NetInterfaceCreate) SetOnPoInterface(p *PortChannelInterface) *NetInterfaceCreate

SetOnPoInterface sets the "on_po_interface" edge to the PortChannelInterface entity.

func (*NetInterfaceCreate) SetOnPoInterfaceID added in v0.2.0

func (nic *NetInterfaceCreate) SetOnPoInterfaceID(id int) *NetInterfaceCreate

SetOnPoInterfaceID sets the "on_po_interface" edge to the PortChannelInterface entity by ID.

type NetInterfaceCreateBulk

type NetInterfaceCreateBulk struct {
	// contains filtered or unexported fields
}

NetInterfaceCreateBulk is the builder for creating many NetInterface entities in bulk.

func (*NetInterfaceCreateBulk) Save

Save creates the NetInterface entities in the database.

func (*NetInterfaceCreateBulk) SaveX

func (nicb *NetInterfaceCreateBulk) SaveX(ctx context.Context) []*NetInterface

SaveX is like Save, but panics if an error occurs.

type NetInterfaceDelete

type NetInterfaceDelete struct {
	// contains filtered or unexported fields
}

NetInterfaceDelete is the builder for deleting a NetInterface entity.

func (*NetInterfaceDelete) Exec

func (nid *NetInterfaceDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*NetInterfaceDelete) ExecX

func (nid *NetInterfaceDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*NetInterfaceDelete) Where

Where adds a new predicate to the NetInterfaceDelete builder.

type NetInterfaceDeleteOne

type NetInterfaceDeleteOne struct {
	// contains filtered or unexported fields
}

NetInterfaceDeleteOne is the builder for deleting a single NetInterface entity.

func (*NetInterfaceDeleteOne) Exec

func (nido *NetInterfaceDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*NetInterfaceDeleteOne) ExecX

func (nido *NetInterfaceDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type NetInterfaceEdges

type NetInterfaceEdges struct {
	// OnDevice holds the value of the on_device edge.
	OnDevice *Device `json:"on_device,omitempty"`
	// OnPoInterface holds the value of the on_po_interface edge.
	OnPoInterface *PortChannelInterface `json:"on_po_interface,omitempty"`
	// OnIPAddress holds the value of the on_ip_address edge.
	OnIPAddress *IPAddress `json:"on_ip_address,omitempty"`
	// IPStaticRouting holds the value of the ip_static_routing edge.
	IPStaticRouting []*IPStaticRoutingTable `json:"ip_static_routing,omitempty"`
	// Mode holds the value of the mode edge.
	Mode *NetInterfaceMode `json:"mode,omitempty"`
	// OnLayer holds the value of the on_layer edge.
	OnLayer *NetInterfaceLayer `json:"on_layer,omitempty"`
	// HaveVlans holds the value of the have_vlans edge.
	HaveVlans []*Vlan `json:"have_vlans,omitempty"`
	// NativeOnVlan holds the value of the native_on_vlan edge.
	NativeOnVlan *Vlan `json:"native_on_vlan,omitempty"`
	// contains filtered or unexported fields
}

NetInterfaceEdges holds the relations/edges for other nodes in the graph.

func (NetInterfaceEdges) HaveVlansOrErr

func (e NetInterfaceEdges) HaveVlansOrErr() ([]*Vlan, error)

HaveVlansOrErr returns the HaveVlans value or an error if the edge was not loaded in eager-loading.

func (NetInterfaceEdges) IPStaticRoutingOrErr added in v0.2.0

func (e NetInterfaceEdges) IPStaticRoutingOrErr() ([]*IPStaticRoutingTable, error)

IPStaticRoutingOrErr returns the IPStaticRouting value or an error if the edge was not loaded in eager-loading.

func (NetInterfaceEdges) ModeOrErr

func (e NetInterfaceEdges) ModeOrErr() (*NetInterfaceMode, error)

ModeOrErr returns the Mode value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (NetInterfaceEdges) NativeOnVlanOrErr

func (e NetInterfaceEdges) NativeOnVlanOrErr() (*Vlan, error)

NativeOnVlanOrErr returns the NativeOnVlan value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (NetInterfaceEdges) OnDeviceOrErr

func (e NetInterfaceEdges) OnDeviceOrErr() (*Device, error)

OnDeviceOrErr returns the OnDevice value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (NetInterfaceEdges) OnIPAddressOrErr added in v0.2.0

func (e NetInterfaceEdges) OnIPAddressOrErr() (*IPAddress, error)

OnIPAddressOrErr returns the OnIPAddress value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (NetInterfaceEdges) OnLayerOrErr added in v0.2.0

func (e NetInterfaceEdges) OnLayerOrErr() (*NetInterfaceLayer, error)

OnLayerOrErr returns the OnLayer value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (NetInterfaceEdges) OnPoInterfaceOrErr added in v0.2.0

func (e NetInterfaceEdges) OnPoInterfaceOrErr() (*PortChannelInterface, error)

OnPoInterfaceOrErr returns the OnPoInterface value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type NetInterfaceGroupBy

type NetInterfaceGroupBy struct {
	// contains filtered or unexported fields
}

NetInterfaceGroupBy is the group-by builder for NetInterface entities.

func (*NetInterfaceGroupBy) Aggregate

func (nigb *NetInterfaceGroupBy) Aggregate(fns ...AggregateFunc) *NetInterfaceGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*NetInterfaceGroupBy) Bool

func (nigb *NetInterfaceGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*NetInterfaceGroupBy) BoolX

func (nigb *NetInterfaceGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*NetInterfaceGroupBy) Bools

func (nigb *NetInterfaceGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*NetInterfaceGroupBy) BoolsX

func (nigb *NetInterfaceGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*NetInterfaceGroupBy) Float64

func (nigb *NetInterfaceGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*NetInterfaceGroupBy) Float64X

func (nigb *NetInterfaceGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*NetInterfaceGroupBy) Float64s

func (nigb *NetInterfaceGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*NetInterfaceGroupBy) Float64sX

func (nigb *NetInterfaceGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*NetInterfaceGroupBy) Int

func (nigb *NetInterfaceGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*NetInterfaceGroupBy) IntX

func (nigb *NetInterfaceGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*NetInterfaceGroupBy) Ints

func (nigb *NetInterfaceGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*NetInterfaceGroupBy) IntsX

func (nigb *NetInterfaceGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*NetInterfaceGroupBy) Scan

func (nigb *NetInterfaceGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*NetInterfaceGroupBy) ScanX

func (nigb *NetInterfaceGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*NetInterfaceGroupBy) String

func (nigb *NetInterfaceGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*NetInterfaceGroupBy) StringX

func (nigb *NetInterfaceGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*NetInterfaceGroupBy) Strings

func (nigb *NetInterfaceGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*NetInterfaceGroupBy) StringsX

func (nigb *NetInterfaceGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type NetInterfaceLayer added in v0.2.0

type NetInterfaceLayer struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// InterfaceLayer holds the value of the "interface_layer" field.
	InterfaceLayer int `json:"interface_layer,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the NetInterfaceLayerQuery when eager-loading is set.
	Edges NetInterfaceLayerEdges `json:"edges"`
	// contains filtered or unexported fields
}

NetInterfaceLayer is the model entity for the NetInterfaceLayer schema.

func (*NetInterfaceLayer) QueryLayers added in v0.2.0

func (nil *NetInterfaceLayer) QueryLayers() *NetInterfaceQuery

QueryLayers queries the "layers" edge of the NetInterfaceLayer entity.

func (*NetInterfaceLayer) QueryPoLayers added in v0.2.0

func (nil *NetInterfaceLayer) QueryPoLayers() *PortChannelInterfaceQuery

QueryPoLayers queries the "po_layers" edge of the NetInterfaceLayer entity.

func (*NetInterfaceLayer) String added in v0.2.0

func (nil *NetInterfaceLayer) String() string

String implements the fmt.Stringer.

func (*NetInterfaceLayer) Unwrap added in v0.2.0

func (nil *NetInterfaceLayer) Unwrap() *NetInterfaceLayer

Unwrap unwraps the NetInterfaceLayer 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 (*NetInterfaceLayer) Update added in v0.2.0

Update returns a builder for updating this NetInterfaceLayer. Note that you need to call NetInterfaceLayer.Unwrap() before calling this method if this NetInterfaceLayer was returned from a transaction, and the transaction was committed or rolled back.

type NetInterfaceLayerClient added in v0.2.0

type NetInterfaceLayerClient struct {
	// contains filtered or unexported fields
}

NetInterfaceLayerClient is a client for the NetInterfaceLayer schema.

func NewNetInterfaceLayerClient added in v0.2.0

func NewNetInterfaceLayerClient(c config) *NetInterfaceLayerClient

NewNetInterfaceLayerClient returns a client for the NetInterfaceLayer from the given config.

func (*NetInterfaceLayerClient) Create added in v0.2.0

Create returns a create builder for NetInterfaceLayer.

func (*NetInterfaceLayerClient) CreateBulk added in v0.2.0

CreateBulk returns a builder for creating a bulk of NetInterfaceLayer entities.

func (*NetInterfaceLayerClient) Delete added in v0.2.0

Delete returns a delete builder for NetInterfaceLayer.

func (*NetInterfaceLayerClient) DeleteOne added in v0.2.0

DeleteOne returns a delete builder for the given entity.

func (*NetInterfaceLayerClient) DeleteOneID added in v0.2.0

DeleteOneID returns a delete builder for the given id.

func (*NetInterfaceLayerClient) Get added in v0.2.0

Get returns a NetInterfaceLayer entity by its id.

func (*NetInterfaceLayerClient) GetX added in v0.2.0

GetX is like Get, but panics if an error occurs.

func (*NetInterfaceLayerClient) Hooks added in v0.2.0

func (c *NetInterfaceLayerClient) Hooks() []Hook

Hooks returns the client hooks.

func (*NetInterfaceLayerClient) Query added in v0.2.0

Query returns a query builder for NetInterfaceLayer.

func (*NetInterfaceLayerClient) QueryLayers added in v0.2.0

QueryLayers queries the layers edge of a NetInterfaceLayer.

func (*NetInterfaceLayerClient) QueryPoLayers added in v0.2.0

QueryPoLayers queries the po_layers edge of a NetInterfaceLayer.

func (*NetInterfaceLayerClient) Update added in v0.2.0

Update returns an update builder for NetInterfaceLayer.

func (*NetInterfaceLayerClient) UpdateOne added in v0.2.0

UpdateOne returns an update builder for the given entity.

func (*NetInterfaceLayerClient) UpdateOneID added in v0.2.0

UpdateOneID returns an update builder for the given id.

func (*NetInterfaceLayerClient) Use added in v0.2.0

func (c *NetInterfaceLayerClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `netinterfacelayer.Hooks(f(g(h())))`.

type NetInterfaceLayerCreate added in v0.2.0

type NetInterfaceLayerCreate struct {
	// contains filtered or unexported fields
}

NetInterfaceLayerCreate is the builder for creating a NetInterfaceLayer entity.

func (*NetInterfaceLayerCreate) AddLayerIDs added in v0.2.0

func (nilc *NetInterfaceLayerCreate) AddLayerIDs(ids ...int) *NetInterfaceLayerCreate

AddLayerIDs adds the "layers" edge to the NetInterface entity by IDs.

func (*NetInterfaceLayerCreate) AddLayers added in v0.2.0

AddLayers adds the "layers" edges to the NetInterface entity.

func (*NetInterfaceLayerCreate) AddPoLayerIDs added in v0.2.0

func (nilc *NetInterfaceLayerCreate) AddPoLayerIDs(ids ...int) *NetInterfaceLayerCreate

AddPoLayerIDs adds the "po_layers" edge to the PortChannelInterface entity by IDs.

func (*NetInterfaceLayerCreate) AddPoLayers added in v0.2.0

AddPoLayers adds the "po_layers" edges to the PortChannelInterface entity.

func (*NetInterfaceLayerCreate) Mutation added in v0.2.0

Mutation returns the NetInterfaceLayerMutation object of the builder.

func (*NetInterfaceLayerCreate) Save added in v0.2.0

Save creates the NetInterfaceLayer in the database.

func (*NetInterfaceLayerCreate) SaveX added in v0.2.0

SaveX calls Save and panics if Save returns an error.

func (*NetInterfaceLayerCreate) SetInterfaceLayer added in v0.2.0

func (nilc *NetInterfaceLayerCreate) SetInterfaceLayer(i int) *NetInterfaceLayerCreate

SetInterfaceLayer sets the "interface_layer" field.

type NetInterfaceLayerCreateBulk added in v0.2.0

type NetInterfaceLayerCreateBulk struct {
	// contains filtered or unexported fields
}

NetInterfaceLayerCreateBulk is the builder for creating many NetInterfaceLayer entities in bulk.

func (*NetInterfaceLayerCreateBulk) Save added in v0.2.0

Save creates the NetInterfaceLayer entities in the database.

func (*NetInterfaceLayerCreateBulk) SaveX added in v0.2.0

SaveX is like Save, but panics if an error occurs.

type NetInterfaceLayerDelete added in v0.2.0

type NetInterfaceLayerDelete struct {
	// contains filtered or unexported fields
}

NetInterfaceLayerDelete is the builder for deleting a NetInterfaceLayer entity.

func (*NetInterfaceLayerDelete) Exec added in v0.2.0

func (nild *NetInterfaceLayerDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*NetInterfaceLayerDelete) ExecX added in v0.2.0

func (nild *NetInterfaceLayerDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*NetInterfaceLayerDelete) Where added in v0.2.0

Where adds a new predicate to the NetInterfaceLayerDelete builder.

type NetInterfaceLayerDeleteOne added in v0.2.0

type NetInterfaceLayerDeleteOne struct {
	// contains filtered or unexported fields
}

NetInterfaceLayerDeleteOne is the builder for deleting a single NetInterfaceLayer entity.

func (*NetInterfaceLayerDeleteOne) Exec added in v0.2.0

Exec executes the deletion query.

func (*NetInterfaceLayerDeleteOne) ExecX added in v0.2.0

func (nildo *NetInterfaceLayerDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type NetInterfaceLayerEdges added in v0.2.0

type NetInterfaceLayerEdges struct {
	// Layers holds the value of the layers edge.
	Layers []*NetInterface `json:"layers,omitempty"`
	// PoLayers holds the value of the po_layers edge.
	PoLayers []*PortChannelInterface `json:"po_layers,omitempty"`
	// contains filtered or unexported fields
}

NetInterfaceLayerEdges holds the relations/edges for other nodes in the graph.

func (NetInterfaceLayerEdges) LayersOrErr added in v0.2.0

func (e NetInterfaceLayerEdges) LayersOrErr() ([]*NetInterface, error)

LayersOrErr returns the Layers value or an error if the edge was not loaded in eager-loading.

func (NetInterfaceLayerEdges) PoLayersOrErr added in v0.2.0

func (e NetInterfaceLayerEdges) PoLayersOrErr() ([]*PortChannelInterface, error)

PoLayersOrErr returns the PoLayers value or an error if the edge was not loaded in eager-loading.

type NetInterfaceLayerGroupBy added in v0.2.0

type NetInterfaceLayerGroupBy struct {
	// contains filtered or unexported fields
}

NetInterfaceLayerGroupBy is the group-by builder for NetInterfaceLayer entities.

func (*NetInterfaceLayerGroupBy) Aggregate added in v0.2.0

Aggregate adds the given aggregation functions to the group-by query.

func (*NetInterfaceLayerGroupBy) Bool added in v0.2.0

func (nilgb *NetInterfaceLayerGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*NetInterfaceLayerGroupBy) BoolX added in v0.2.0

func (nilgb *NetInterfaceLayerGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*NetInterfaceLayerGroupBy) Bools added in v0.2.0

func (nilgb *NetInterfaceLayerGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*NetInterfaceLayerGroupBy) BoolsX added in v0.2.0

func (nilgb *NetInterfaceLayerGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*NetInterfaceLayerGroupBy) Float64 added in v0.2.0

func (nilgb *NetInterfaceLayerGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*NetInterfaceLayerGroupBy) Float64X added in v0.2.0

func (nilgb *NetInterfaceLayerGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*NetInterfaceLayerGroupBy) Float64s added in v0.2.0

func (nilgb *NetInterfaceLayerGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*NetInterfaceLayerGroupBy) Float64sX added in v0.2.0

func (nilgb *NetInterfaceLayerGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*NetInterfaceLayerGroupBy) Int added in v0.2.0

func (nilgb *NetInterfaceLayerGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*NetInterfaceLayerGroupBy) IntX added in v0.2.0

func (nilgb *NetInterfaceLayerGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*NetInterfaceLayerGroupBy) Ints added in v0.2.0

func (nilgb *NetInterfaceLayerGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*NetInterfaceLayerGroupBy) IntsX added in v0.2.0

func (nilgb *NetInterfaceLayerGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*NetInterfaceLayerGroupBy) Scan added in v0.2.0

func (nilgb *NetInterfaceLayerGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*NetInterfaceLayerGroupBy) ScanX added in v0.2.0

func (nilgb *NetInterfaceLayerGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*NetInterfaceLayerGroupBy) String added in v0.2.0

func (nilgb *NetInterfaceLayerGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*NetInterfaceLayerGroupBy) StringX added in v0.2.0

func (nilgb *NetInterfaceLayerGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*NetInterfaceLayerGroupBy) Strings added in v0.2.0

func (nilgb *NetInterfaceLayerGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*NetInterfaceLayerGroupBy) StringsX added in v0.2.0

func (nilgb *NetInterfaceLayerGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type NetInterfaceLayerMutation added in v0.2.0

type NetInterfaceLayerMutation struct {
	// contains filtered or unexported fields
}

NetInterfaceLayerMutation represents an operation that mutates the NetInterfaceLayer nodes in the graph.

func (*NetInterfaceLayerMutation) AddField added in v0.2.0

func (m *NetInterfaceLayerMutation) 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 (*NetInterfaceLayerMutation) AddInterfaceLayer added in v0.2.0

func (m *NetInterfaceLayerMutation) AddInterfaceLayer(i int)

AddInterfaceLayer adds i to the "interface_layer" field.

func (*NetInterfaceLayerMutation) AddLayerIDs added in v0.2.0

func (m *NetInterfaceLayerMutation) AddLayerIDs(ids ...int)

AddLayerIDs adds the "layers" edge to the NetInterface entity by ids.

func (*NetInterfaceLayerMutation) AddPoLayerIDs added in v0.2.0

func (m *NetInterfaceLayerMutation) AddPoLayerIDs(ids ...int)

AddPoLayerIDs adds the "po_layers" edge to the PortChannelInterface entity by ids.

func (*NetInterfaceLayerMutation) AddedEdges added in v0.2.0

func (m *NetInterfaceLayerMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*NetInterfaceLayerMutation) AddedField added in v0.2.0

func (m *NetInterfaceLayerMutation) 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 (*NetInterfaceLayerMutation) AddedFields added in v0.2.0

func (m *NetInterfaceLayerMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*NetInterfaceLayerMutation) AddedIDs added in v0.2.0

func (m *NetInterfaceLayerMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*NetInterfaceLayerMutation) AddedInterfaceLayer added in v0.2.0

func (m *NetInterfaceLayerMutation) AddedInterfaceLayer() (r int, exists bool)

AddedInterfaceLayer returns the value that was added to the "interface_layer" field in this mutation.

func (*NetInterfaceLayerMutation) ClearEdge added in v0.2.0

func (m *NetInterfaceLayerMutation) 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 (*NetInterfaceLayerMutation) ClearField added in v0.2.0

func (m *NetInterfaceLayerMutation) 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 (*NetInterfaceLayerMutation) ClearLayers added in v0.2.0

func (m *NetInterfaceLayerMutation) ClearLayers()

ClearLayers clears the "layers" edge to the NetInterface entity.

func (*NetInterfaceLayerMutation) ClearPoLayers added in v0.2.0

func (m *NetInterfaceLayerMutation) ClearPoLayers()

ClearPoLayers clears the "po_layers" edge to the PortChannelInterface entity.

func (*NetInterfaceLayerMutation) ClearedEdges added in v0.2.0

func (m *NetInterfaceLayerMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*NetInterfaceLayerMutation) ClearedFields added in v0.2.0

func (m *NetInterfaceLayerMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (NetInterfaceLayerMutation) Client added in v0.2.0

func (m NetInterfaceLayerMutation) 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 (*NetInterfaceLayerMutation) EdgeCleared added in v0.2.0

func (m *NetInterfaceLayerMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*NetInterfaceLayerMutation) Field added in v0.2.0

func (m *NetInterfaceLayerMutation) 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 (*NetInterfaceLayerMutation) FieldCleared added in v0.2.0

func (m *NetInterfaceLayerMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*NetInterfaceLayerMutation) Fields added in v0.2.0

func (m *NetInterfaceLayerMutation) 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 (*NetInterfaceLayerMutation) ID added in v0.2.0

func (m *NetInterfaceLayerMutation) 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.

func (*NetInterfaceLayerMutation) InterfaceLayer added in v0.2.0

func (m *NetInterfaceLayerMutation) InterfaceLayer() (r int, exists bool)

InterfaceLayer returns the value of the "interface_layer" field in the mutation.

func (*NetInterfaceLayerMutation) LayersCleared added in v0.2.0

func (m *NetInterfaceLayerMutation) LayersCleared() bool

LayersCleared reports if the "layers" edge to the NetInterface entity was cleared.

func (*NetInterfaceLayerMutation) LayersIDs added in v0.2.0

func (m *NetInterfaceLayerMutation) LayersIDs() (ids []int)

LayersIDs returns the "layers" edge IDs in the mutation.

func (*NetInterfaceLayerMutation) OldField added in v0.2.0

func (m *NetInterfaceLayerMutation) 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 (*NetInterfaceLayerMutation) OldInterfaceLayer added in v0.2.0

func (m *NetInterfaceLayerMutation) OldInterfaceLayer(ctx context.Context) (v int, err error)

OldInterfaceLayer returns the old "interface_layer" field's value of the NetInterfaceLayer entity. If the NetInterfaceLayer 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 (*NetInterfaceLayerMutation) Op added in v0.2.0

func (m *NetInterfaceLayerMutation) Op() Op

Op returns the operation name.

func (*NetInterfaceLayerMutation) PoLayersCleared added in v0.2.0

func (m *NetInterfaceLayerMutation) PoLayersCleared() bool

PoLayersCleared reports if the "po_layers" edge to the PortChannelInterface entity was cleared.

func (*NetInterfaceLayerMutation) PoLayersIDs added in v0.2.0

func (m *NetInterfaceLayerMutation) PoLayersIDs() (ids []int)

PoLayersIDs returns the "po_layers" edge IDs in the mutation.

func (*NetInterfaceLayerMutation) RemoveLayerIDs added in v0.2.0

func (m *NetInterfaceLayerMutation) RemoveLayerIDs(ids ...int)

RemoveLayerIDs removes the "layers" edge to the NetInterface entity by IDs.

func (*NetInterfaceLayerMutation) RemovePoLayerIDs added in v0.2.0

func (m *NetInterfaceLayerMutation) RemovePoLayerIDs(ids ...int)

RemovePoLayerIDs removes the "po_layers" edge to the PortChannelInterface entity by IDs.

func (*NetInterfaceLayerMutation) RemovedEdges added in v0.2.0

func (m *NetInterfaceLayerMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*NetInterfaceLayerMutation) RemovedIDs added in v0.2.0

func (m *NetInterfaceLayerMutation) 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 (*NetInterfaceLayerMutation) RemovedLayersIDs added in v0.2.0

func (m *NetInterfaceLayerMutation) RemovedLayersIDs() (ids []int)

RemovedLayers returns the removed IDs of the "layers" edge to the NetInterface entity.

func (*NetInterfaceLayerMutation) RemovedPoLayersIDs added in v0.2.0

func (m *NetInterfaceLayerMutation) RemovedPoLayersIDs() (ids []int)

RemovedPoLayers returns the removed IDs of the "po_layers" edge to the PortChannelInterface entity.

func (*NetInterfaceLayerMutation) ResetEdge added in v0.2.0

func (m *NetInterfaceLayerMutation) 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 (*NetInterfaceLayerMutation) ResetField added in v0.2.0

func (m *NetInterfaceLayerMutation) 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 (*NetInterfaceLayerMutation) ResetInterfaceLayer added in v0.2.0

func (m *NetInterfaceLayerMutation) ResetInterfaceLayer()

ResetInterfaceLayer resets all changes to the "interface_layer" field.

func (*NetInterfaceLayerMutation) ResetLayers added in v0.2.0

func (m *NetInterfaceLayerMutation) ResetLayers()

ResetLayers resets all changes to the "layers" edge.

func (*NetInterfaceLayerMutation) ResetPoLayers added in v0.2.0

func (m *NetInterfaceLayerMutation) ResetPoLayers()

ResetPoLayers resets all changes to the "po_layers" edge.

func (*NetInterfaceLayerMutation) SetField added in v0.2.0

func (m *NetInterfaceLayerMutation) 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 (*NetInterfaceLayerMutation) SetInterfaceLayer added in v0.2.0

func (m *NetInterfaceLayerMutation) SetInterfaceLayer(i int)

SetInterfaceLayer sets the "interface_layer" field.

func (NetInterfaceLayerMutation) Tx added in v0.2.0

func (m NetInterfaceLayerMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*NetInterfaceLayerMutation) Type added in v0.2.0

Type returns the node type of this mutation (NetInterfaceLayer).

type NetInterfaceLayerQuery added in v0.2.0

type NetInterfaceLayerQuery struct {
	// contains filtered or unexported fields
}

NetInterfaceLayerQuery is the builder for querying NetInterfaceLayer entities.

func (*NetInterfaceLayerQuery) All added in v0.2.0

All executes the query and returns a list of NetInterfaceLayers.

func (*NetInterfaceLayerQuery) AllX added in v0.2.0

AllX is like All, but panics if an error occurs.

func (*NetInterfaceLayerQuery) Clone added in v0.2.0

Clone returns a duplicate of the NetInterfaceLayerQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*NetInterfaceLayerQuery) Count added in v0.2.0

func (nilq *NetInterfaceLayerQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*NetInterfaceLayerQuery) CountX added in v0.2.0

func (nilq *NetInterfaceLayerQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*NetInterfaceLayerQuery) Exist added in v0.2.0

func (nilq *NetInterfaceLayerQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*NetInterfaceLayerQuery) ExistX added in v0.2.0

func (nilq *NetInterfaceLayerQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*NetInterfaceLayerQuery) First added in v0.2.0

First returns the first NetInterfaceLayer entity from the query. Returns a *NotFoundError when no NetInterfaceLayer was found.

func (*NetInterfaceLayerQuery) FirstID added in v0.2.0

func (nilq *NetInterfaceLayerQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first NetInterfaceLayer ID from the query. Returns a *NotFoundError when no NetInterfaceLayer ID was found.

func (*NetInterfaceLayerQuery) FirstIDX added in v0.2.0

func (nilq *NetInterfaceLayerQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*NetInterfaceLayerQuery) FirstX added in v0.2.0

FirstX is like First, but panics if an error occurs.

func (*NetInterfaceLayerQuery) GroupBy added in v0.2.0

func (nilq *NetInterfaceLayerQuery) GroupBy(field string, fields ...string) *NetInterfaceLayerGroupBy

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 {
	InterfaceLayer int `json:"interface_layer,omitempty"`
	Count int `json:"count,omitempty"`
}

client.NetInterfaceLayer.Query().
	GroupBy(netinterfacelayer.FieldInterfaceLayer).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*NetInterfaceLayerQuery) IDs added in v0.2.0

func (nilq *NetInterfaceLayerQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of NetInterfaceLayer IDs.

func (*NetInterfaceLayerQuery) IDsX added in v0.2.0

func (nilq *NetInterfaceLayerQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*NetInterfaceLayerQuery) Limit added in v0.2.0

Limit adds a limit step to the query.

func (*NetInterfaceLayerQuery) Offset added in v0.2.0

func (nilq *NetInterfaceLayerQuery) Offset(offset int) *NetInterfaceLayerQuery

Offset adds an offset step to the query.

func (*NetInterfaceLayerQuery) Only added in v0.2.0

Only returns a single NetInterfaceLayer entity found by the query, ensuring it only returns one. Returns a *NotSingularError when exactly one NetInterfaceLayer entity is not found. Returns a *NotFoundError when no NetInterfaceLayer entities are found.

func (*NetInterfaceLayerQuery) OnlyID added in v0.2.0

func (nilq *NetInterfaceLayerQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only NetInterfaceLayer ID in the query. Returns a *NotSingularError when exactly one NetInterfaceLayer ID is not found. Returns a *NotFoundError when no entities are found.

func (*NetInterfaceLayerQuery) OnlyIDX added in v0.2.0

func (nilq *NetInterfaceLayerQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*NetInterfaceLayerQuery) OnlyX added in v0.2.0

OnlyX is like Only, but panics if an error occurs.

func (*NetInterfaceLayerQuery) Order added in v0.2.0

Order adds an order step to the query.

func (*NetInterfaceLayerQuery) QueryLayers added in v0.2.0

func (nilq *NetInterfaceLayerQuery) QueryLayers() *NetInterfaceQuery

QueryLayers chains the current query on the "layers" edge.

func (*NetInterfaceLayerQuery) QueryPoLayers added in v0.2.0

func (nilq *NetInterfaceLayerQuery) QueryPoLayers() *PortChannelInterfaceQuery

QueryPoLayers chains the current query on the "po_layers" edge.

func (*NetInterfaceLayerQuery) Select added in v0.2.0

func (nilq *NetInterfaceLayerQuery) Select(field string, fields ...string) *NetInterfaceLayerSelect

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 {
	InterfaceLayer int `json:"interface_layer,omitempty"`
}

client.NetInterfaceLayer.Query().
	Select(netinterfacelayer.FieldInterfaceLayer).
	Scan(ctx, &v)

func (*NetInterfaceLayerQuery) Unique added in v0.2.0

func (nilq *NetInterfaceLayerQuery) Unique(unique bool) *NetInterfaceLayerQuery

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 (*NetInterfaceLayerQuery) Where added in v0.2.0

Where adds a new predicate for the NetInterfaceLayerQuery builder.

func (*NetInterfaceLayerQuery) WithLayers added in v0.2.0

func (nilq *NetInterfaceLayerQuery) WithLayers(opts ...func(*NetInterfaceQuery)) *NetInterfaceLayerQuery

WithLayers tells the query-builder to eager-load the nodes that are connected to the "layers" edge. The optional arguments are used to configure the query builder of the edge.

func (*NetInterfaceLayerQuery) WithPoLayers added in v0.2.0

func (nilq *NetInterfaceLayerQuery) WithPoLayers(opts ...func(*PortChannelInterfaceQuery)) *NetInterfaceLayerQuery

WithPoLayers tells the query-builder to eager-load the nodes that are connected to the "po_layers" edge. The optional arguments are used to configure the query builder of the edge.

type NetInterfaceLayerSelect added in v0.2.0

type NetInterfaceLayerSelect struct {
	*NetInterfaceLayerQuery
	// contains filtered or unexported fields
}

NetInterfaceLayerSelect is the builder for selecting fields of NetInterfaceLayer entities.

func (*NetInterfaceLayerSelect) Bool added in v0.2.0

func (nils *NetInterfaceLayerSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*NetInterfaceLayerSelect) BoolX added in v0.2.0

func (nils *NetInterfaceLayerSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*NetInterfaceLayerSelect) Bools added in v0.2.0

func (nils *NetInterfaceLayerSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*NetInterfaceLayerSelect) BoolsX added in v0.2.0

func (nils *NetInterfaceLayerSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*NetInterfaceLayerSelect) Float64 added in v0.2.0

func (nils *NetInterfaceLayerSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*NetInterfaceLayerSelect) Float64X added in v0.2.0

func (nils *NetInterfaceLayerSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*NetInterfaceLayerSelect) Float64s added in v0.2.0

func (nils *NetInterfaceLayerSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*NetInterfaceLayerSelect) Float64sX added in v0.2.0

func (nils *NetInterfaceLayerSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*NetInterfaceLayerSelect) Int added in v0.2.0

func (nils *NetInterfaceLayerSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*NetInterfaceLayerSelect) IntX added in v0.2.0

func (nils *NetInterfaceLayerSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*NetInterfaceLayerSelect) Ints added in v0.2.0

func (nils *NetInterfaceLayerSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*NetInterfaceLayerSelect) IntsX added in v0.2.0

func (nils *NetInterfaceLayerSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*NetInterfaceLayerSelect) Scan added in v0.2.0

func (nils *NetInterfaceLayerSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*NetInterfaceLayerSelect) ScanX added in v0.2.0

func (nils *NetInterfaceLayerSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*NetInterfaceLayerSelect) String added in v0.2.0

func (nils *NetInterfaceLayerSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*NetInterfaceLayerSelect) StringX added in v0.2.0

func (nils *NetInterfaceLayerSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*NetInterfaceLayerSelect) Strings added in v0.2.0

func (nils *NetInterfaceLayerSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*NetInterfaceLayerSelect) StringsX added in v0.2.0

func (nils *NetInterfaceLayerSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type NetInterfaceLayerUpdate added in v0.2.0

type NetInterfaceLayerUpdate struct {
	// contains filtered or unexported fields
}

NetInterfaceLayerUpdate is the builder for updating NetInterfaceLayer entities.

func (*NetInterfaceLayerUpdate) AddInterfaceLayer added in v0.2.0

func (nilu *NetInterfaceLayerUpdate) AddInterfaceLayer(i int) *NetInterfaceLayerUpdate

AddInterfaceLayer adds i to the "interface_layer" field.

func (*NetInterfaceLayerUpdate) AddLayerIDs added in v0.2.0

func (nilu *NetInterfaceLayerUpdate) AddLayerIDs(ids ...int) *NetInterfaceLayerUpdate

AddLayerIDs adds the "layers" edge to the NetInterface entity by IDs.

func (*NetInterfaceLayerUpdate) AddLayers added in v0.2.0

AddLayers adds the "layers" edges to the NetInterface entity.

func (*NetInterfaceLayerUpdate) AddPoLayerIDs added in v0.2.0

func (nilu *NetInterfaceLayerUpdate) AddPoLayerIDs(ids ...int) *NetInterfaceLayerUpdate

AddPoLayerIDs adds the "po_layers" edge to the PortChannelInterface entity by IDs.

func (*NetInterfaceLayerUpdate) AddPoLayers added in v0.2.0

AddPoLayers adds the "po_layers" edges to the PortChannelInterface entity.

func (*NetInterfaceLayerUpdate) ClearLayers added in v0.2.0

func (nilu *NetInterfaceLayerUpdate) ClearLayers() *NetInterfaceLayerUpdate

ClearLayers clears all "layers" edges to the NetInterface entity.

func (*NetInterfaceLayerUpdate) ClearPoLayers added in v0.2.0

func (nilu *NetInterfaceLayerUpdate) ClearPoLayers() *NetInterfaceLayerUpdate

ClearPoLayers clears all "po_layers" edges to the PortChannelInterface entity.

func (*NetInterfaceLayerUpdate) Exec added in v0.2.0

func (nilu *NetInterfaceLayerUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*NetInterfaceLayerUpdate) ExecX added in v0.2.0

func (nilu *NetInterfaceLayerUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NetInterfaceLayerUpdate) Mutation added in v0.2.0

Mutation returns the NetInterfaceLayerMutation object of the builder.

func (*NetInterfaceLayerUpdate) RemoveLayerIDs added in v0.2.0

func (nilu *NetInterfaceLayerUpdate) RemoveLayerIDs(ids ...int) *NetInterfaceLayerUpdate

RemoveLayerIDs removes the "layers" edge to NetInterface entities by IDs.

func (*NetInterfaceLayerUpdate) RemoveLayers added in v0.2.0

RemoveLayers removes "layers" edges to NetInterface entities.

func (*NetInterfaceLayerUpdate) RemovePoLayerIDs added in v0.2.0

func (nilu *NetInterfaceLayerUpdate) RemovePoLayerIDs(ids ...int) *NetInterfaceLayerUpdate

RemovePoLayerIDs removes the "po_layers" edge to PortChannelInterface entities by IDs.

func (*NetInterfaceLayerUpdate) RemovePoLayers added in v0.2.0

RemovePoLayers removes "po_layers" edges to PortChannelInterface entities.

func (*NetInterfaceLayerUpdate) Save added in v0.2.0

func (nilu *NetInterfaceLayerUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*NetInterfaceLayerUpdate) SaveX added in v0.2.0

func (nilu *NetInterfaceLayerUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*NetInterfaceLayerUpdate) SetInterfaceLayer added in v0.2.0

func (nilu *NetInterfaceLayerUpdate) SetInterfaceLayer(i int) *NetInterfaceLayerUpdate

SetInterfaceLayer sets the "interface_layer" field.

func (*NetInterfaceLayerUpdate) Where added in v0.2.0

Where adds a new predicate for the NetInterfaceLayerUpdate builder.

type NetInterfaceLayerUpdateOne added in v0.2.0

type NetInterfaceLayerUpdateOne struct {
	// contains filtered or unexported fields
}

NetInterfaceLayerUpdateOne is the builder for updating a single NetInterfaceLayer entity.

func (*NetInterfaceLayerUpdateOne) AddInterfaceLayer added in v0.2.0

func (niluo *NetInterfaceLayerUpdateOne) AddInterfaceLayer(i int) *NetInterfaceLayerUpdateOne

AddInterfaceLayer adds i to the "interface_layer" field.

func (*NetInterfaceLayerUpdateOne) AddLayerIDs added in v0.2.0

func (niluo *NetInterfaceLayerUpdateOne) AddLayerIDs(ids ...int) *NetInterfaceLayerUpdateOne

AddLayerIDs adds the "layers" edge to the NetInterface entity by IDs.

func (*NetInterfaceLayerUpdateOne) AddLayers added in v0.2.0

AddLayers adds the "layers" edges to the NetInterface entity.

func (*NetInterfaceLayerUpdateOne) AddPoLayerIDs added in v0.2.0

func (niluo *NetInterfaceLayerUpdateOne) AddPoLayerIDs(ids ...int) *NetInterfaceLayerUpdateOne

AddPoLayerIDs adds the "po_layers" edge to the PortChannelInterface entity by IDs.

func (*NetInterfaceLayerUpdateOne) AddPoLayers added in v0.2.0

AddPoLayers adds the "po_layers" edges to the PortChannelInterface entity.

func (*NetInterfaceLayerUpdateOne) ClearLayers added in v0.2.0

ClearLayers clears all "layers" edges to the NetInterface entity.

func (*NetInterfaceLayerUpdateOne) ClearPoLayers added in v0.2.0

ClearPoLayers clears all "po_layers" edges to the PortChannelInterface entity.

func (*NetInterfaceLayerUpdateOne) Exec added in v0.2.0

Exec executes the query on the entity.

func (*NetInterfaceLayerUpdateOne) ExecX added in v0.2.0

func (niluo *NetInterfaceLayerUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NetInterfaceLayerUpdateOne) Mutation added in v0.2.0

Mutation returns the NetInterfaceLayerMutation object of the builder.

func (*NetInterfaceLayerUpdateOne) RemoveLayerIDs added in v0.2.0

func (niluo *NetInterfaceLayerUpdateOne) RemoveLayerIDs(ids ...int) *NetInterfaceLayerUpdateOne

RemoveLayerIDs removes the "layers" edge to NetInterface entities by IDs.

func (*NetInterfaceLayerUpdateOne) RemoveLayers added in v0.2.0

RemoveLayers removes "layers" edges to NetInterface entities.

func (*NetInterfaceLayerUpdateOne) RemovePoLayerIDs added in v0.2.0

func (niluo *NetInterfaceLayerUpdateOne) RemovePoLayerIDs(ids ...int) *NetInterfaceLayerUpdateOne

RemovePoLayerIDs removes the "po_layers" edge to PortChannelInterface entities by IDs.

func (*NetInterfaceLayerUpdateOne) RemovePoLayers added in v0.2.0

RemovePoLayers removes "po_layers" edges to PortChannelInterface entities.

func (*NetInterfaceLayerUpdateOne) Save added in v0.2.0

Save executes the query and returns the updated NetInterfaceLayer entity.

func (*NetInterfaceLayerUpdateOne) SaveX added in v0.2.0

SaveX is like Save, but panics if an error occurs.

func (*NetInterfaceLayerUpdateOne) Select added in v0.2.0

func (niluo *NetInterfaceLayerUpdateOne) Select(field string, fields ...string) *NetInterfaceLayerUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*NetInterfaceLayerUpdateOne) SetInterfaceLayer added in v0.2.0

func (niluo *NetInterfaceLayerUpdateOne) SetInterfaceLayer(i int) *NetInterfaceLayerUpdateOne

SetInterfaceLayer sets the "interface_layer" field.

type NetInterfaceLayers added in v0.2.0

type NetInterfaceLayers []*NetInterfaceLayer

NetInterfaceLayers is a parsable slice of NetInterfaceLayer.

type NetInterfaceMode

type NetInterfaceMode struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// InterfaceMode holds the value of the "interface_mode" field.
	InterfaceMode string `json:"interface_mode,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the NetInterfaceModeQuery when eager-loading is set.
	Edges NetInterfaceModeEdges `json:"edges"`
	// contains filtered or unexported fields
}

NetInterfaceMode is the model entity for the NetInterfaceMode schema.

func (*NetInterfaceMode) QueryModes

func (nim *NetInterfaceMode) QueryModes() *NetInterfaceQuery

QueryModes queries the "modes" edge of the NetInterfaceMode entity.

func (*NetInterfaceMode) QueryPoModes added in v0.2.0

func (nim *NetInterfaceMode) QueryPoModes() *PortChannelInterfaceQuery

QueryPoModes queries the "po_modes" edge of the NetInterfaceMode entity.

func (*NetInterfaceMode) String

func (nim *NetInterfaceMode) String() string

String implements the fmt.Stringer.

func (*NetInterfaceMode) Unwrap

func (nim *NetInterfaceMode) Unwrap() *NetInterfaceMode

Unwrap unwraps the NetInterfaceMode 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 (*NetInterfaceMode) Update

Update returns a builder for updating this NetInterfaceMode. Note that you need to call NetInterfaceMode.Unwrap() before calling this method if this NetInterfaceMode was returned from a transaction, and the transaction was committed or rolled back.

type NetInterfaceModeClient

type NetInterfaceModeClient struct {
	// contains filtered or unexported fields
}

NetInterfaceModeClient is a client for the NetInterfaceMode schema.

func NewNetInterfaceModeClient

func NewNetInterfaceModeClient(c config) *NetInterfaceModeClient

NewNetInterfaceModeClient returns a client for the NetInterfaceMode from the given config.

func (*NetInterfaceModeClient) Create

Create returns a create builder for NetInterfaceMode.

func (*NetInterfaceModeClient) CreateBulk

CreateBulk returns a builder for creating a bulk of NetInterfaceMode entities.

func (*NetInterfaceModeClient) Delete

Delete returns a delete builder for NetInterfaceMode.

func (*NetInterfaceModeClient) DeleteOne

DeleteOne returns a delete builder for the given entity.

func (*NetInterfaceModeClient) DeleteOneID

DeleteOneID returns a delete builder for the given id.

func (*NetInterfaceModeClient) Get

Get returns a NetInterfaceMode entity by its id.

func (*NetInterfaceModeClient) GetX

GetX is like Get, but panics if an error occurs.

func (*NetInterfaceModeClient) Hooks

func (c *NetInterfaceModeClient) Hooks() []Hook

Hooks returns the client hooks.

func (*NetInterfaceModeClient) Query

Query returns a query builder for NetInterfaceMode.

func (*NetInterfaceModeClient) QueryModes

QueryModes queries the modes edge of a NetInterfaceMode.

func (*NetInterfaceModeClient) QueryPoModes added in v0.2.0

QueryPoModes queries the po_modes edge of a NetInterfaceMode.

func (*NetInterfaceModeClient) Update

Update returns an update builder for NetInterfaceMode.

func (*NetInterfaceModeClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*NetInterfaceModeClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*NetInterfaceModeClient) Use

func (c *NetInterfaceModeClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `netinterfacemode.Hooks(f(g(h())))`.

type NetInterfaceModeCreate

type NetInterfaceModeCreate struct {
	// contains filtered or unexported fields
}

NetInterfaceModeCreate is the builder for creating a NetInterfaceMode entity.

func (*NetInterfaceModeCreate) AddModeIDs

func (nimc *NetInterfaceModeCreate) AddModeIDs(ids ...int) *NetInterfaceModeCreate

AddModeIDs adds the "modes" edge to the NetInterface entity by IDs.

func (*NetInterfaceModeCreate) AddModes

AddModes adds the "modes" edges to the NetInterface entity.

func (*NetInterfaceModeCreate) AddPoModeIDs added in v0.2.0

func (nimc *NetInterfaceModeCreate) AddPoModeIDs(ids ...int) *NetInterfaceModeCreate

AddPoModeIDs adds the "po_modes" edge to the PortChannelInterface entity by IDs.

func (*NetInterfaceModeCreate) AddPoModes added in v0.2.0

AddPoModes adds the "po_modes" edges to the PortChannelInterface entity.

func (*NetInterfaceModeCreate) Mutation

Mutation returns the NetInterfaceModeMutation object of the builder.

func (*NetInterfaceModeCreate) Save

Save creates the NetInterfaceMode in the database.

func (*NetInterfaceModeCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*NetInterfaceModeCreate) SetInterfaceMode

func (nimc *NetInterfaceModeCreate) SetInterfaceMode(s string) *NetInterfaceModeCreate

SetInterfaceMode sets the "interface_mode" field.

type NetInterfaceModeCreateBulk

type NetInterfaceModeCreateBulk struct {
	// contains filtered or unexported fields
}

NetInterfaceModeCreateBulk is the builder for creating many NetInterfaceMode entities in bulk.

func (*NetInterfaceModeCreateBulk) Save

Save creates the NetInterfaceMode entities in the database.

func (*NetInterfaceModeCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type NetInterfaceModeDelete

type NetInterfaceModeDelete struct {
	// contains filtered or unexported fields
}

NetInterfaceModeDelete is the builder for deleting a NetInterfaceMode entity.

func (*NetInterfaceModeDelete) Exec

func (nimd *NetInterfaceModeDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*NetInterfaceModeDelete) ExecX

func (nimd *NetInterfaceModeDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*NetInterfaceModeDelete) Where

Where adds a new predicate to the NetInterfaceModeDelete builder.

type NetInterfaceModeDeleteOne

type NetInterfaceModeDeleteOne struct {
	// contains filtered or unexported fields
}

NetInterfaceModeDeleteOne is the builder for deleting a single NetInterfaceMode entity.

func (*NetInterfaceModeDeleteOne) Exec

Exec executes the deletion query.

func (*NetInterfaceModeDeleteOne) ExecX

func (nimdo *NetInterfaceModeDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type NetInterfaceModeEdges

type NetInterfaceModeEdges struct {
	// Modes holds the value of the modes edge.
	Modes []*NetInterface `json:"modes,omitempty"`
	// PoModes holds the value of the po_modes edge.
	PoModes []*PortChannelInterface `json:"po_modes,omitempty"`
	// contains filtered or unexported fields
}

NetInterfaceModeEdges holds the relations/edges for other nodes in the graph.

func (NetInterfaceModeEdges) ModesOrErr

func (e NetInterfaceModeEdges) ModesOrErr() ([]*NetInterface, error)

ModesOrErr returns the Modes value or an error if the edge was not loaded in eager-loading.

func (NetInterfaceModeEdges) PoModesOrErr added in v0.2.0

func (e NetInterfaceModeEdges) PoModesOrErr() ([]*PortChannelInterface, error)

PoModesOrErr returns the PoModes value or an error if the edge was not loaded in eager-loading.

type NetInterfaceModeGroupBy

type NetInterfaceModeGroupBy struct {
	// contains filtered or unexported fields
}

NetInterfaceModeGroupBy is the group-by builder for NetInterfaceMode entities.

func (*NetInterfaceModeGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*NetInterfaceModeGroupBy) Bool

func (nimgb *NetInterfaceModeGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*NetInterfaceModeGroupBy) BoolX

func (nimgb *NetInterfaceModeGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*NetInterfaceModeGroupBy) Bools

func (nimgb *NetInterfaceModeGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*NetInterfaceModeGroupBy) BoolsX

func (nimgb *NetInterfaceModeGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*NetInterfaceModeGroupBy) Float64

func (nimgb *NetInterfaceModeGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*NetInterfaceModeGroupBy) Float64X

func (nimgb *NetInterfaceModeGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*NetInterfaceModeGroupBy) Float64s

func (nimgb *NetInterfaceModeGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*NetInterfaceModeGroupBy) Float64sX

func (nimgb *NetInterfaceModeGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*NetInterfaceModeGroupBy) Int

func (nimgb *NetInterfaceModeGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*NetInterfaceModeGroupBy) IntX

func (nimgb *NetInterfaceModeGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*NetInterfaceModeGroupBy) Ints

func (nimgb *NetInterfaceModeGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*NetInterfaceModeGroupBy) IntsX

func (nimgb *NetInterfaceModeGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*NetInterfaceModeGroupBy) Scan

func (nimgb *NetInterfaceModeGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*NetInterfaceModeGroupBy) ScanX

func (nimgb *NetInterfaceModeGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*NetInterfaceModeGroupBy) String

func (nimgb *NetInterfaceModeGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*NetInterfaceModeGroupBy) StringX

func (nimgb *NetInterfaceModeGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*NetInterfaceModeGroupBy) Strings

func (nimgb *NetInterfaceModeGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*NetInterfaceModeGroupBy) StringsX

func (nimgb *NetInterfaceModeGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type NetInterfaceModeMutation

type NetInterfaceModeMutation struct {
	// contains filtered or unexported fields
}

NetInterfaceModeMutation represents an operation that mutates the NetInterfaceMode nodes in the graph.

func (*NetInterfaceModeMutation) AddField

func (m *NetInterfaceModeMutation) 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 (*NetInterfaceModeMutation) AddModeIDs

func (m *NetInterfaceModeMutation) AddModeIDs(ids ...int)

AddModeIDs adds the "modes" edge to the NetInterface entity by ids.

func (*NetInterfaceModeMutation) AddPoModeIDs added in v0.2.0

func (m *NetInterfaceModeMutation) AddPoModeIDs(ids ...int)

AddPoModeIDs adds the "po_modes" edge to the PortChannelInterface entity by ids.

func (*NetInterfaceModeMutation) AddedEdges

func (m *NetInterfaceModeMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*NetInterfaceModeMutation) AddedField

func (m *NetInterfaceModeMutation) 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 (*NetInterfaceModeMutation) AddedFields

func (m *NetInterfaceModeMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*NetInterfaceModeMutation) AddedIDs

func (m *NetInterfaceModeMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*NetInterfaceModeMutation) ClearEdge

func (m *NetInterfaceModeMutation) 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 (*NetInterfaceModeMutation) ClearField

func (m *NetInterfaceModeMutation) 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 (*NetInterfaceModeMutation) ClearModes

func (m *NetInterfaceModeMutation) ClearModes()

ClearModes clears the "modes" edge to the NetInterface entity.

func (*NetInterfaceModeMutation) ClearPoModes added in v0.2.0

func (m *NetInterfaceModeMutation) ClearPoModes()

ClearPoModes clears the "po_modes" edge to the PortChannelInterface entity.

func (*NetInterfaceModeMutation) ClearedEdges

func (m *NetInterfaceModeMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*NetInterfaceModeMutation) ClearedFields

func (m *NetInterfaceModeMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (NetInterfaceModeMutation) Client

func (m NetInterfaceModeMutation) 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 (*NetInterfaceModeMutation) EdgeCleared

func (m *NetInterfaceModeMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*NetInterfaceModeMutation) Field

func (m *NetInterfaceModeMutation) 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 (*NetInterfaceModeMutation) FieldCleared

func (m *NetInterfaceModeMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*NetInterfaceModeMutation) Fields

func (m *NetInterfaceModeMutation) 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 (*NetInterfaceModeMutation) ID

func (m *NetInterfaceModeMutation) 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.

func (*NetInterfaceModeMutation) InterfaceMode

func (m *NetInterfaceModeMutation) InterfaceMode() (r string, exists bool)

InterfaceMode returns the value of the "interface_mode" field in the mutation.

func (*NetInterfaceModeMutation) ModesCleared

func (m *NetInterfaceModeMutation) ModesCleared() bool

ModesCleared reports if the "modes" edge to the NetInterface entity was cleared.

func (*NetInterfaceModeMutation) ModesIDs

func (m *NetInterfaceModeMutation) ModesIDs() (ids []int)

ModesIDs returns the "modes" edge IDs in the mutation.

func (*NetInterfaceModeMutation) OldField

func (m *NetInterfaceModeMutation) 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 (*NetInterfaceModeMutation) OldInterfaceMode

func (m *NetInterfaceModeMutation) OldInterfaceMode(ctx context.Context) (v string, err error)

OldInterfaceMode returns the old "interface_mode" field's value of the NetInterfaceMode entity. If the NetInterfaceMode 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 (*NetInterfaceModeMutation) Op

func (m *NetInterfaceModeMutation) Op() Op

Op returns the operation name.

func (*NetInterfaceModeMutation) PoModesCleared added in v0.2.0

func (m *NetInterfaceModeMutation) PoModesCleared() bool

PoModesCleared reports if the "po_modes" edge to the PortChannelInterface entity was cleared.

func (*NetInterfaceModeMutation) PoModesIDs added in v0.2.0

func (m *NetInterfaceModeMutation) PoModesIDs() (ids []int)

PoModesIDs returns the "po_modes" edge IDs in the mutation.

func (*NetInterfaceModeMutation) RemoveModeIDs

func (m *NetInterfaceModeMutation) RemoveModeIDs(ids ...int)

RemoveModeIDs removes the "modes" edge to the NetInterface entity by IDs.

func (*NetInterfaceModeMutation) RemovePoModeIDs added in v0.2.0

func (m *NetInterfaceModeMutation) RemovePoModeIDs(ids ...int)

RemovePoModeIDs removes the "po_modes" edge to the PortChannelInterface entity by IDs.

func (*NetInterfaceModeMutation) RemovedEdges

func (m *NetInterfaceModeMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*NetInterfaceModeMutation) RemovedIDs

func (m *NetInterfaceModeMutation) 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 (*NetInterfaceModeMutation) RemovedModesIDs

func (m *NetInterfaceModeMutation) RemovedModesIDs() (ids []int)

RemovedModes returns the removed IDs of the "modes" edge to the NetInterface entity.

func (*NetInterfaceModeMutation) RemovedPoModesIDs added in v0.2.0

func (m *NetInterfaceModeMutation) RemovedPoModesIDs() (ids []int)

RemovedPoModes returns the removed IDs of the "po_modes" edge to the PortChannelInterface entity.

func (*NetInterfaceModeMutation) ResetEdge

func (m *NetInterfaceModeMutation) 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 (*NetInterfaceModeMutation) ResetField

func (m *NetInterfaceModeMutation) 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 (*NetInterfaceModeMutation) ResetInterfaceMode

func (m *NetInterfaceModeMutation) ResetInterfaceMode()

ResetInterfaceMode resets all changes to the "interface_mode" field.

func (*NetInterfaceModeMutation) ResetModes

func (m *NetInterfaceModeMutation) ResetModes()

ResetModes resets all changes to the "modes" edge.

func (*NetInterfaceModeMutation) ResetPoModes added in v0.2.0

func (m *NetInterfaceModeMutation) ResetPoModes()

ResetPoModes resets all changes to the "po_modes" edge.

func (*NetInterfaceModeMutation) SetField

func (m *NetInterfaceModeMutation) 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 (*NetInterfaceModeMutation) SetInterfaceMode

func (m *NetInterfaceModeMutation) SetInterfaceMode(s string)

SetInterfaceMode sets the "interface_mode" field.

func (NetInterfaceModeMutation) Tx

func (m NetInterfaceModeMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*NetInterfaceModeMutation) Type

func (m *NetInterfaceModeMutation) Type() string

Type returns the node type of this mutation (NetInterfaceMode).

type NetInterfaceModeQuery

type NetInterfaceModeQuery struct {
	// contains filtered or unexported fields
}

NetInterfaceModeQuery is the builder for querying NetInterfaceMode entities.

func (*NetInterfaceModeQuery) All

All executes the query and returns a list of NetInterfaceModes.

func (*NetInterfaceModeQuery) AllX

AllX is like All, but panics if an error occurs.

func (*NetInterfaceModeQuery) Clone

Clone returns a duplicate of the NetInterfaceModeQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*NetInterfaceModeQuery) Count

func (nimq *NetInterfaceModeQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*NetInterfaceModeQuery) CountX

func (nimq *NetInterfaceModeQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*NetInterfaceModeQuery) Exist

func (nimq *NetInterfaceModeQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*NetInterfaceModeQuery) ExistX

func (nimq *NetInterfaceModeQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*NetInterfaceModeQuery) First

First returns the first NetInterfaceMode entity from the query. Returns a *NotFoundError when no NetInterfaceMode was found.

func (*NetInterfaceModeQuery) FirstID

func (nimq *NetInterfaceModeQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first NetInterfaceMode ID from the query. Returns a *NotFoundError when no NetInterfaceMode ID was found.

func (*NetInterfaceModeQuery) FirstIDX

func (nimq *NetInterfaceModeQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*NetInterfaceModeQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*NetInterfaceModeQuery) GroupBy

func (nimq *NetInterfaceModeQuery) GroupBy(field string, fields ...string) *NetInterfaceModeGroupBy

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 {
	InterfaceMode string `json:"interface_mode,omitempty"`
	Count int `json:"count,omitempty"`
}

client.NetInterfaceMode.Query().
	GroupBy(netinterfacemode.FieldInterfaceMode).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*NetInterfaceModeQuery) IDs

func (nimq *NetInterfaceModeQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of NetInterfaceMode IDs.

func (*NetInterfaceModeQuery) IDsX

func (nimq *NetInterfaceModeQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*NetInterfaceModeQuery) Limit

func (nimq *NetInterfaceModeQuery) Limit(limit int) *NetInterfaceModeQuery

Limit adds a limit step to the query.

func (*NetInterfaceModeQuery) Offset

func (nimq *NetInterfaceModeQuery) Offset(offset int) *NetInterfaceModeQuery

Offset adds an offset step to the query.

func (*NetInterfaceModeQuery) Only

Only returns a single NetInterfaceMode entity found by the query, ensuring it only returns one. Returns a *NotSingularError when exactly one NetInterfaceMode entity is not found. Returns a *NotFoundError when no NetInterfaceMode entities are found.

func (*NetInterfaceModeQuery) OnlyID

func (nimq *NetInterfaceModeQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only NetInterfaceMode ID in the query. Returns a *NotSingularError when exactly one NetInterfaceMode ID is not found. Returns a *NotFoundError when no entities are found.

func (*NetInterfaceModeQuery) OnlyIDX

func (nimq *NetInterfaceModeQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*NetInterfaceModeQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*NetInterfaceModeQuery) Order

Order adds an order step to the query.

func (*NetInterfaceModeQuery) QueryModes

func (nimq *NetInterfaceModeQuery) QueryModes() *NetInterfaceQuery

QueryModes chains the current query on the "modes" edge.

func (*NetInterfaceModeQuery) QueryPoModes added in v0.2.0

func (nimq *NetInterfaceModeQuery) QueryPoModes() *PortChannelInterfaceQuery

QueryPoModes chains the current query on the "po_modes" edge.

func (*NetInterfaceModeQuery) Select

func (nimq *NetInterfaceModeQuery) Select(field string, fields ...string) *NetInterfaceModeSelect

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 {
	InterfaceMode string `json:"interface_mode,omitempty"`
}

client.NetInterfaceMode.Query().
	Select(netinterfacemode.FieldInterfaceMode).
	Scan(ctx, &v)

func (*NetInterfaceModeQuery) Unique

func (nimq *NetInterfaceModeQuery) Unique(unique bool) *NetInterfaceModeQuery

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 (*NetInterfaceModeQuery) Where

Where adds a new predicate for the NetInterfaceModeQuery builder.

func (*NetInterfaceModeQuery) WithModes

func (nimq *NetInterfaceModeQuery) WithModes(opts ...func(*NetInterfaceQuery)) *NetInterfaceModeQuery

WithModes tells the query-builder to eager-load the nodes that are connected to the "modes" edge. The optional arguments are used to configure the query builder of the edge.

func (*NetInterfaceModeQuery) WithPoModes added in v0.2.0

func (nimq *NetInterfaceModeQuery) WithPoModes(opts ...func(*PortChannelInterfaceQuery)) *NetInterfaceModeQuery

WithPoModes tells the query-builder to eager-load the nodes that are connected to the "po_modes" edge. The optional arguments are used to configure the query builder of the edge.

type NetInterfaceModeSelect

type NetInterfaceModeSelect struct {
	*NetInterfaceModeQuery
	// contains filtered or unexported fields
}

NetInterfaceModeSelect is the builder for selecting fields of NetInterfaceMode entities.

func (*NetInterfaceModeSelect) Bool

func (nims *NetInterfaceModeSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*NetInterfaceModeSelect) BoolX

func (nims *NetInterfaceModeSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*NetInterfaceModeSelect) Bools

func (nims *NetInterfaceModeSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*NetInterfaceModeSelect) BoolsX

func (nims *NetInterfaceModeSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*NetInterfaceModeSelect) Float64

func (nims *NetInterfaceModeSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*NetInterfaceModeSelect) Float64X

func (nims *NetInterfaceModeSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*NetInterfaceModeSelect) Float64s

func (nims *NetInterfaceModeSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*NetInterfaceModeSelect) Float64sX

func (nims *NetInterfaceModeSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*NetInterfaceModeSelect) Int

func (nims *NetInterfaceModeSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*NetInterfaceModeSelect) IntX

func (nims *NetInterfaceModeSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*NetInterfaceModeSelect) Ints

func (nims *NetInterfaceModeSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*NetInterfaceModeSelect) IntsX

func (nims *NetInterfaceModeSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*NetInterfaceModeSelect) Scan

func (nims *NetInterfaceModeSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*NetInterfaceModeSelect) ScanX

func (nims *NetInterfaceModeSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*NetInterfaceModeSelect) String

func (nims *NetInterfaceModeSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*NetInterfaceModeSelect) StringX

func (nims *NetInterfaceModeSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*NetInterfaceModeSelect) Strings

func (nims *NetInterfaceModeSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*NetInterfaceModeSelect) StringsX

func (nims *NetInterfaceModeSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type NetInterfaceModeUpdate

type NetInterfaceModeUpdate struct {
	// contains filtered or unexported fields
}

NetInterfaceModeUpdate is the builder for updating NetInterfaceMode entities.

func (*NetInterfaceModeUpdate) AddModeIDs

func (nimu *NetInterfaceModeUpdate) AddModeIDs(ids ...int) *NetInterfaceModeUpdate

AddModeIDs adds the "modes" edge to the NetInterface entity by IDs.

func (*NetInterfaceModeUpdate) AddModes

AddModes adds the "modes" edges to the NetInterface entity.

func (*NetInterfaceModeUpdate) AddPoModeIDs added in v0.2.0

func (nimu *NetInterfaceModeUpdate) AddPoModeIDs(ids ...int) *NetInterfaceModeUpdate

AddPoModeIDs adds the "po_modes" edge to the PortChannelInterface entity by IDs.

func (*NetInterfaceModeUpdate) AddPoModes added in v0.2.0

AddPoModes adds the "po_modes" edges to the PortChannelInterface entity.

func (*NetInterfaceModeUpdate) ClearModes

func (nimu *NetInterfaceModeUpdate) ClearModes() *NetInterfaceModeUpdate

ClearModes clears all "modes" edges to the NetInterface entity.

func (*NetInterfaceModeUpdate) ClearPoModes added in v0.2.0

func (nimu *NetInterfaceModeUpdate) ClearPoModes() *NetInterfaceModeUpdate

ClearPoModes clears all "po_modes" edges to the PortChannelInterface entity.

func (*NetInterfaceModeUpdate) Exec

func (nimu *NetInterfaceModeUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*NetInterfaceModeUpdate) ExecX

func (nimu *NetInterfaceModeUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NetInterfaceModeUpdate) Mutation

Mutation returns the NetInterfaceModeMutation object of the builder.

func (*NetInterfaceModeUpdate) RemoveModeIDs

func (nimu *NetInterfaceModeUpdate) RemoveModeIDs(ids ...int) *NetInterfaceModeUpdate

RemoveModeIDs removes the "modes" edge to NetInterface entities by IDs.

func (*NetInterfaceModeUpdate) RemoveModes

RemoveModes removes "modes" edges to NetInterface entities.

func (*NetInterfaceModeUpdate) RemovePoModeIDs added in v0.2.0

func (nimu *NetInterfaceModeUpdate) RemovePoModeIDs(ids ...int) *NetInterfaceModeUpdate

RemovePoModeIDs removes the "po_modes" edge to PortChannelInterface entities by IDs.

func (*NetInterfaceModeUpdate) RemovePoModes added in v0.2.0

RemovePoModes removes "po_modes" edges to PortChannelInterface entities.

func (*NetInterfaceModeUpdate) Save

func (nimu *NetInterfaceModeUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*NetInterfaceModeUpdate) SaveX

func (nimu *NetInterfaceModeUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*NetInterfaceModeUpdate) SetInterfaceMode

func (nimu *NetInterfaceModeUpdate) SetInterfaceMode(s string) *NetInterfaceModeUpdate

SetInterfaceMode sets the "interface_mode" field.

func (*NetInterfaceModeUpdate) Where

Where adds a new predicate for the NetInterfaceModeUpdate builder.

type NetInterfaceModeUpdateOne

type NetInterfaceModeUpdateOne struct {
	// contains filtered or unexported fields
}

NetInterfaceModeUpdateOne is the builder for updating a single NetInterfaceMode entity.

func (*NetInterfaceModeUpdateOne) AddModeIDs

func (nimuo *NetInterfaceModeUpdateOne) AddModeIDs(ids ...int) *NetInterfaceModeUpdateOne

AddModeIDs adds the "modes" edge to the NetInterface entity by IDs.

func (*NetInterfaceModeUpdateOne) AddModes

AddModes adds the "modes" edges to the NetInterface entity.

func (*NetInterfaceModeUpdateOne) AddPoModeIDs added in v0.2.0

func (nimuo *NetInterfaceModeUpdateOne) AddPoModeIDs(ids ...int) *NetInterfaceModeUpdateOne

AddPoModeIDs adds the "po_modes" edge to the PortChannelInterface entity by IDs.

func (*NetInterfaceModeUpdateOne) AddPoModes added in v0.2.0

AddPoModes adds the "po_modes" edges to the PortChannelInterface entity.

func (*NetInterfaceModeUpdateOne) ClearModes

ClearModes clears all "modes" edges to the NetInterface entity.

func (*NetInterfaceModeUpdateOne) ClearPoModes added in v0.2.0

ClearPoModes clears all "po_modes" edges to the PortChannelInterface entity.

func (*NetInterfaceModeUpdateOne) Exec

Exec executes the query on the entity.

func (*NetInterfaceModeUpdateOne) ExecX

func (nimuo *NetInterfaceModeUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NetInterfaceModeUpdateOne) Mutation

Mutation returns the NetInterfaceModeMutation object of the builder.

func (*NetInterfaceModeUpdateOne) RemoveModeIDs

func (nimuo *NetInterfaceModeUpdateOne) RemoveModeIDs(ids ...int) *NetInterfaceModeUpdateOne

RemoveModeIDs removes the "modes" edge to NetInterface entities by IDs.

func (*NetInterfaceModeUpdateOne) RemoveModes

RemoveModes removes "modes" edges to NetInterface entities.

func (*NetInterfaceModeUpdateOne) RemovePoModeIDs added in v0.2.0

func (nimuo *NetInterfaceModeUpdateOne) RemovePoModeIDs(ids ...int) *NetInterfaceModeUpdateOne

RemovePoModeIDs removes the "po_modes" edge to PortChannelInterface entities by IDs.

func (*NetInterfaceModeUpdateOne) RemovePoModes added in v0.2.0

RemovePoModes removes "po_modes" edges to PortChannelInterface entities.

func (*NetInterfaceModeUpdateOne) Save

Save executes the query and returns the updated NetInterfaceMode entity.

func (*NetInterfaceModeUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*NetInterfaceModeUpdateOne) Select

func (nimuo *NetInterfaceModeUpdateOne) Select(field string, fields ...string) *NetInterfaceModeUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*NetInterfaceModeUpdateOne) SetInterfaceMode

func (nimuo *NetInterfaceModeUpdateOne) SetInterfaceMode(s string) *NetInterfaceModeUpdateOne

SetInterfaceMode sets the "interface_mode" field.

type NetInterfaceModes

type NetInterfaceModes []*NetInterfaceMode

NetInterfaceModes is a parsable slice of NetInterfaceMode.

type NetInterfaceMutation

type NetInterfaceMutation struct {
	// contains filtered or unexported fields
}

NetInterfaceMutation represents an operation that mutates the NetInterface nodes in the graph.

func (*NetInterfaceMutation) AddField

func (m *NetInterfaceMutation) 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 (*NetInterfaceMutation) AddHaveVlanIDs

func (m *NetInterfaceMutation) AddHaveVlanIDs(ids ...int)

AddHaveVlanIDs adds the "have_vlans" edge to the Vlan entity by ids.

func (*NetInterfaceMutation) AddIPStaticRoutingIDs added in v0.2.0

func (m *NetInterfaceMutation) AddIPStaticRoutingIDs(ids ...int)

AddIPStaticRoutingIDs adds the "ip_static_routing" edge to the IPStaticRoutingTable entity by ids.

func (*NetInterfaceMutation) AddedEdges

func (m *NetInterfaceMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*NetInterfaceMutation) AddedField

func (m *NetInterfaceMutation) 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 (*NetInterfaceMutation) AddedFields

func (m *NetInterfaceMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*NetInterfaceMutation) AddedIDs

func (m *NetInterfaceMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*NetInterfaceMutation) ClearEdge

func (m *NetInterfaceMutation) 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 (*NetInterfaceMutation) ClearField

func (m *NetInterfaceMutation) 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 (*NetInterfaceMutation) ClearHaveVlans

func (m *NetInterfaceMutation) ClearHaveVlans()

ClearHaveVlans clears the "have_vlans" edge to the Vlan entity.

func (*NetInterfaceMutation) ClearIPStaticRouting added in v0.2.0

func (m *NetInterfaceMutation) ClearIPStaticRouting()

ClearIPStaticRouting clears the "ip_static_routing" edge to the IPStaticRoutingTable entity.

func (*NetInterfaceMutation) ClearMode

func (m *NetInterfaceMutation) ClearMode()

ClearMode clears the "mode" edge to the NetInterfaceMode entity.

func (*NetInterfaceMutation) ClearNativeOnVlan

func (m *NetInterfaceMutation) ClearNativeOnVlan()

ClearNativeOnVlan clears the "native_on_vlan" edge to the Vlan entity.

func (*NetInterfaceMutation) ClearOnDevice

func (m *NetInterfaceMutation) ClearOnDevice()

ClearOnDevice clears the "on_device" edge to the Device entity.

func (*NetInterfaceMutation) ClearOnIPAddress added in v0.2.0

func (m *NetInterfaceMutation) ClearOnIPAddress()

ClearOnIPAddress clears the "on_ip_address" edge to the IPAddress entity.

func (*NetInterfaceMutation) ClearOnLayer added in v0.2.0

func (m *NetInterfaceMutation) ClearOnLayer()

ClearOnLayer clears the "on_layer" edge to the NetInterfaceLayer entity.

func (*NetInterfaceMutation) ClearOnPoInterface added in v0.2.0

func (m *NetInterfaceMutation) ClearOnPoInterface()

ClearOnPoInterface clears the "on_po_interface" edge to the PortChannelInterface entity.

func (*NetInterfaceMutation) ClearedEdges

func (m *NetInterfaceMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*NetInterfaceMutation) ClearedFields

func (m *NetInterfaceMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (NetInterfaceMutation) Client

func (m NetInterfaceMutation) 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 (*NetInterfaceMutation) EdgeCleared

func (m *NetInterfaceMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*NetInterfaceMutation) Field

func (m *NetInterfaceMutation) 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 (*NetInterfaceMutation) FieldCleared

func (m *NetInterfaceMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*NetInterfaceMutation) Fields

func (m *NetInterfaceMutation) 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 (*NetInterfaceMutation) HaveVlansCleared

func (m *NetInterfaceMutation) HaveVlansCleared() bool

HaveVlansCleared reports if the "have_vlans" edge to the Vlan entity was cleared.

func (*NetInterfaceMutation) HaveVlansIDs

func (m *NetInterfaceMutation) HaveVlansIDs() (ids []int)

HaveVlansIDs returns the "have_vlans" edge IDs in the mutation.

func (*NetInterfaceMutation) ID

func (m *NetInterfaceMutation) 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.

func (*NetInterfaceMutation) IPStaticRoutingCleared added in v0.2.0

func (m *NetInterfaceMutation) IPStaticRoutingCleared() bool

IPStaticRoutingCleared reports if the "ip_static_routing" edge to the IPStaticRoutingTable entity was cleared.

func (*NetInterfaceMutation) IPStaticRoutingIDs added in v0.2.0

func (m *NetInterfaceMutation) IPStaticRoutingIDs() (ids []int)

IPStaticRoutingIDs returns the "ip_static_routing" edge IDs in the mutation.

func (*NetInterfaceMutation) InterfaceName

func (m *NetInterfaceMutation) InterfaceName() (r string, exists bool)

InterfaceName returns the value of the "interface_name" field in the mutation.

func (*NetInterfaceMutation) InterfaceShutdown

func (m *NetInterfaceMutation) InterfaceShutdown() (r bool, exists bool)

InterfaceShutdown returns the value of the "interface_shutdown" field in the mutation.

func (*NetInterfaceMutation) ModeCleared

func (m *NetInterfaceMutation) ModeCleared() bool

ModeCleared reports if the "mode" edge to the NetInterfaceMode entity was cleared.

func (*NetInterfaceMutation) ModeID

func (m *NetInterfaceMutation) ModeID() (id int, exists bool)

ModeID returns the "mode" edge ID in the mutation.

func (*NetInterfaceMutation) ModeIDs

func (m *NetInterfaceMutation) ModeIDs() (ids []int)

ModeIDs returns the "mode" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ModeID instead. It exists only for internal usage by the builders.

func (*NetInterfaceMutation) NativeOnVlanCleared

func (m *NetInterfaceMutation) NativeOnVlanCleared() bool

NativeOnVlanCleared reports if the "native_on_vlan" edge to the Vlan entity was cleared.

func (*NetInterfaceMutation) NativeOnVlanID

func (m *NetInterfaceMutation) NativeOnVlanID() (id int, exists bool)

NativeOnVlanID returns the "native_on_vlan" edge ID in the mutation.

func (*NetInterfaceMutation) NativeOnVlanIDs

func (m *NetInterfaceMutation) NativeOnVlanIDs() (ids []int)

NativeOnVlanIDs returns the "native_on_vlan" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use NativeOnVlanID instead. It exists only for internal usage by the builders.

func (*NetInterfaceMutation) OldField

func (m *NetInterfaceMutation) 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 (*NetInterfaceMutation) OldInterfaceName

func (m *NetInterfaceMutation) OldInterfaceName(ctx context.Context) (v string, err error)

OldInterfaceName returns the old "interface_name" field's value of the NetInterface entity. If the NetInterface 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 (*NetInterfaceMutation) OldInterfaceShutdown

func (m *NetInterfaceMutation) OldInterfaceShutdown(ctx context.Context) (v bool, err error)

OldInterfaceShutdown returns the old "interface_shutdown" field's value of the NetInterface entity. If the NetInterface 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 (*NetInterfaceMutation) OnDeviceCleared

func (m *NetInterfaceMutation) OnDeviceCleared() bool

OnDeviceCleared reports if the "on_device" edge to the Device entity was cleared.

func (*NetInterfaceMutation) OnDeviceID

func (m *NetInterfaceMutation) OnDeviceID() (id int, exists bool)

OnDeviceID returns the "on_device" edge ID in the mutation.

func (*NetInterfaceMutation) OnDeviceIDs

func (m *NetInterfaceMutation) OnDeviceIDs() (ids []int)

OnDeviceIDs returns the "on_device" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use OnDeviceID instead. It exists only for internal usage by the builders.

func (*NetInterfaceMutation) OnIPAddressCleared added in v0.2.0

func (m *NetInterfaceMutation) OnIPAddressCleared() bool

OnIPAddressCleared reports if the "on_ip_address" edge to the IPAddress entity was cleared.

func (*NetInterfaceMutation) OnIPAddressID added in v0.2.0

func (m *NetInterfaceMutation) OnIPAddressID() (id int, exists bool)

OnIPAddressID returns the "on_ip_address" edge ID in the mutation.

func (*NetInterfaceMutation) OnIPAddressIDs added in v0.2.0

func (m *NetInterfaceMutation) OnIPAddressIDs() (ids []int)

OnIPAddressIDs returns the "on_ip_address" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use OnIPAddressID instead. It exists only for internal usage by the builders.

func (*NetInterfaceMutation) OnLayerCleared added in v0.2.0

func (m *NetInterfaceMutation) OnLayerCleared() bool

OnLayerCleared reports if the "on_layer" edge to the NetInterfaceLayer entity was cleared.

func (*NetInterfaceMutation) OnLayerID added in v0.2.0

func (m *NetInterfaceMutation) OnLayerID() (id int, exists bool)

OnLayerID returns the "on_layer" edge ID in the mutation.

func (*NetInterfaceMutation) OnLayerIDs added in v0.2.0

func (m *NetInterfaceMutation) OnLayerIDs() (ids []int)

OnLayerIDs returns the "on_layer" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use OnLayerID instead. It exists only for internal usage by the builders.

func (*NetInterfaceMutation) OnPoInterfaceCleared added in v0.2.0

func (m *NetInterfaceMutation) OnPoInterfaceCleared() bool

OnPoInterfaceCleared reports if the "on_po_interface" edge to the PortChannelInterface entity was cleared.

func (*NetInterfaceMutation) OnPoInterfaceID added in v0.2.0

func (m *NetInterfaceMutation) OnPoInterfaceID() (id int, exists bool)

OnPoInterfaceID returns the "on_po_interface" edge ID in the mutation.

func (*NetInterfaceMutation) OnPoInterfaceIDs added in v0.2.0

func (m *NetInterfaceMutation) OnPoInterfaceIDs() (ids []int)

OnPoInterfaceIDs returns the "on_po_interface" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use OnPoInterfaceID instead. It exists only for internal usage by the builders.

func (*NetInterfaceMutation) Op

func (m *NetInterfaceMutation) Op() Op

Op returns the operation name.

func (*NetInterfaceMutation) RemoveHaveVlanIDs

func (m *NetInterfaceMutation) RemoveHaveVlanIDs(ids ...int)

RemoveHaveVlanIDs removes the "have_vlans" edge to the Vlan entity by IDs.

func (*NetInterfaceMutation) RemoveIPStaticRoutingIDs added in v0.2.0

func (m *NetInterfaceMutation) RemoveIPStaticRoutingIDs(ids ...int)

RemoveIPStaticRoutingIDs removes the "ip_static_routing" edge to the IPStaticRoutingTable entity by IDs.

func (*NetInterfaceMutation) RemovedEdges

func (m *NetInterfaceMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*NetInterfaceMutation) RemovedHaveVlansIDs

func (m *NetInterfaceMutation) RemovedHaveVlansIDs() (ids []int)

RemovedHaveVlans returns the removed IDs of the "have_vlans" edge to the Vlan entity.

func (*NetInterfaceMutation) RemovedIDs

func (m *NetInterfaceMutation) 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 (*NetInterfaceMutation) RemovedIPStaticRoutingIDs added in v0.2.0

func (m *NetInterfaceMutation) RemovedIPStaticRoutingIDs() (ids []int)

RemovedIPStaticRouting returns the removed IDs of the "ip_static_routing" edge to the IPStaticRoutingTable entity.

func (*NetInterfaceMutation) ResetEdge

func (m *NetInterfaceMutation) 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 (*NetInterfaceMutation) ResetField

func (m *NetInterfaceMutation) 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 (*NetInterfaceMutation) ResetHaveVlans

func (m *NetInterfaceMutation) ResetHaveVlans()

ResetHaveVlans resets all changes to the "have_vlans" edge.

func (*NetInterfaceMutation) ResetIPStaticRouting added in v0.2.0

func (m *NetInterfaceMutation) ResetIPStaticRouting()

ResetIPStaticRouting resets all changes to the "ip_static_routing" edge.

func (*NetInterfaceMutation) ResetInterfaceName

func (m *NetInterfaceMutation) ResetInterfaceName()

ResetInterfaceName resets all changes to the "interface_name" field.

func (*NetInterfaceMutation) ResetInterfaceShutdown

func (m *NetInterfaceMutation) ResetInterfaceShutdown()

ResetInterfaceShutdown resets all changes to the "interface_shutdown" field.

func (*NetInterfaceMutation) ResetMode

func (m *NetInterfaceMutation) ResetMode()

ResetMode resets all changes to the "mode" edge.

func (*NetInterfaceMutation) ResetNativeOnVlan

func (m *NetInterfaceMutation) ResetNativeOnVlan()

ResetNativeOnVlan resets all changes to the "native_on_vlan" edge.

func (*NetInterfaceMutation) ResetOnDevice

func (m *NetInterfaceMutation) ResetOnDevice()

ResetOnDevice resets all changes to the "on_device" edge.

func (*NetInterfaceMutation) ResetOnIPAddress added in v0.2.0

func (m *NetInterfaceMutation) ResetOnIPAddress()

ResetOnIPAddress resets all changes to the "on_ip_address" edge.

func (*NetInterfaceMutation) ResetOnLayer added in v0.2.0

func (m *NetInterfaceMutation) ResetOnLayer()

ResetOnLayer resets all changes to the "on_layer" edge.

func (*NetInterfaceMutation) ResetOnPoInterface added in v0.2.0

func (m *NetInterfaceMutation) ResetOnPoInterface()

ResetOnPoInterface resets all changes to the "on_po_interface" edge.

func (*NetInterfaceMutation) SetField

func (m *NetInterfaceMutation) 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 (*NetInterfaceMutation) SetInterfaceName

func (m *NetInterfaceMutation) SetInterfaceName(s string)

SetInterfaceName sets the "interface_name" field.

func (*NetInterfaceMutation) SetInterfaceShutdown

func (m *NetInterfaceMutation) SetInterfaceShutdown(b bool)

SetInterfaceShutdown sets the "interface_shutdown" field.

func (*NetInterfaceMutation) SetModeID

func (m *NetInterfaceMutation) SetModeID(id int)

SetModeID sets the "mode" edge to the NetInterfaceMode entity by id.

func (*NetInterfaceMutation) SetNativeOnVlanID

func (m *NetInterfaceMutation) SetNativeOnVlanID(id int)

SetNativeOnVlanID sets the "native_on_vlan" edge to the Vlan entity by id.

func (*NetInterfaceMutation) SetOnDeviceID

func (m *NetInterfaceMutation) SetOnDeviceID(id int)

SetOnDeviceID sets the "on_device" edge to the Device entity by id.

func (*NetInterfaceMutation) SetOnIPAddressID added in v0.2.0

func (m *NetInterfaceMutation) SetOnIPAddressID(id int)

SetOnIPAddressID sets the "on_ip_address" edge to the IPAddress entity by id.

func (*NetInterfaceMutation) SetOnLayerID added in v0.2.0

func (m *NetInterfaceMutation) SetOnLayerID(id int)

SetOnLayerID sets the "on_layer" edge to the NetInterfaceLayer entity by id.

func (*NetInterfaceMutation) SetOnPoInterfaceID added in v0.2.0

func (m *NetInterfaceMutation) SetOnPoInterfaceID(id int)

SetOnPoInterfaceID sets the "on_po_interface" edge to the PortChannelInterface entity by id.

func (NetInterfaceMutation) Tx

func (m NetInterfaceMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*NetInterfaceMutation) Type

func (m *NetInterfaceMutation) Type() string

Type returns the node type of this mutation (NetInterface).

type NetInterfaceQuery

type NetInterfaceQuery struct {
	// contains filtered or unexported fields
}

NetInterfaceQuery is the builder for querying NetInterface entities.

func (*NetInterfaceQuery) All

func (niq *NetInterfaceQuery) All(ctx context.Context) ([]*NetInterface, error)

All executes the query and returns a list of NetInterfaces.

func (*NetInterfaceQuery) AllX

func (niq *NetInterfaceQuery) AllX(ctx context.Context) []*NetInterface

AllX is like All, but panics if an error occurs.

func (*NetInterfaceQuery) Clone

func (niq *NetInterfaceQuery) Clone() *NetInterfaceQuery

Clone returns a duplicate of the NetInterfaceQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*NetInterfaceQuery) Count

func (niq *NetInterfaceQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*NetInterfaceQuery) CountX

func (niq *NetInterfaceQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*NetInterfaceQuery) Exist

func (niq *NetInterfaceQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*NetInterfaceQuery) ExistX

func (niq *NetInterfaceQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*NetInterfaceQuery) First

func (niq *NetInterfaceQuery) First(ctx context.Context) (*NetInterface, error)

First returns the first NetInterface entity from the query. Returns a *NotFoundError when no NetInterface was found.

func (*NetInterfaceQuery) FirstID

func (niq *NetInterfaceQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first NetInterface ID from the query. Returns a *NotFoundError when no NetInterface ID was found.

func (*NetInterfaceQuery) FirstIDX

func (niq *NetInterfaceQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*NetInterfaceQuery) FirstX

func (niq *NetInterfaceQuery) FirstX(ctx context.Context) *NetInterface

FirstX is like First, but panics if an error occurs.

func (*NetInterfaceQuery) GroupBy

func (niq *NetInterfaceQuery) GroupBy(field string, fields ...string) *NetInterfaceGroupBy

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 {
	InterfaceName string `json:"interface_name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.NetInterface.Query().
	GroupBy(netinterface.FieldInterfaceName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*NetInterfaceQuery) IDs

func (niq *NetInterfaceQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of NetInterface IDs.

func (*NetInterfaceQuery) IDsX

func (niq *NetInterfaceQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*NetInterfaceQuery) Limit

func (niq *NetInterfaceQuery) Limit(limit int) *NetInterfaceQuery

Limit adds a limit step to the query.

func (*NetInterfaceQuery) Offset

func (niq *NetInterfaceQuery) Offset(offset int) *NetInterfaceQuery

Offset adds an offset step to the query.

func (*NetInterfaceQuery) Only

func (niq *NetInterfaceQuery) Only(ctx context.Context) (*NetInterface, error)

Only returns a single NetInterface entity found by the query, ensuring it only returns one. Returns a *NotSingularError when exactly one NetInterface entity is not found. Returns a *NotFoundError when no NetInterface entities are found.

func (*NetInterfaceQuery) OnlyID

func (niq *NetInterfaceQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only NetInterface ID in the query. Returns a *NotSingularError when exactly one NetInterface ID is not found. Returns a *NotFoundError when no entities are found.

func (*NetInterfaceQuery) OnlyIDX

func (niq *NetInterfaceQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*NetInterfaceQuery) OnlyX

func (niq *NetInterfaceQuery) OnlyX(ctx context.Context) *NetInterface

OnlyX is like Only, but panics if an error occurs.

func (*NetInterfaceQuery) Order

func (niq *NetInterfaceQuery) Order(o ...OrderFunc) *NetInterfaceQuery

Order adds an order step to the query.

func (*NetInterfaceQuery) QueryHaveVlans

func (niq *NetInterfaceQuery) QueryHaveVlans() *VlanQuery

QueryHaveVlans chains the current query on the "have_vlans" edge.

func (*NetInterfaceQuery) QueryIPStaticRouting added in v0.2.0

func (niq *NetInterfaceQuery) QueryIPStaticRouting() *IPStaticRoutingTableQuery

QueryIPStaticRouting chains the current query on the "ip_static_routing" edge.

func (*NetInterfaceQuery) QueryMode

func (niq *NetInterfaceQuery) QueryMode() *NetInterfaceModeQuery

QueryMode chains the current query on the "mode" edge.

func (*NetInterfaceQuery) QueryNativeOnVlan

func (niq *NetInterfaceQuery) QueryNativeOnVlan() *VlanQuery

QueryNativeOnVlan chains the current query on the "native_on_vlan" edge.

func (*NetInterfaceQuery) QueryOnDevice

func (niq *NetInterfaceQuery) QueryOnDevice() *DeviceQuery

QueryOnDevice chains the current query on the "on_device" edge.

func (*NetInterfaceQuery) QueryOnIPAddress added in v0.2.0

func (niq *NetInterfaceQuery) QueryOnIPAddress() *IPAddressQuery

QueryOnIPAddress chains the current query on the "on_ip_address" edge.

func (*NetInterfaceQuery) QueryOnLayer added in v0.2.0

func (niq *NetInterfaceQuery) QueryOnLayer() *NetInterfaceLayerQuery

QueryOnLayer chains the current query on the "on_layer" edge.

func (*NetInterfaceQuery) QueryOnPoInterface added in v0.2.0

func (niq *NetInterfaceQuery) QueryOnPoInterface() *PortChannelInterfaceQuery

QueryOnPoInterface chains the current query on the "on_po_interface" edge.

func (*NetInterfaceQuery) Select

func (niq *NetInterfaceQuery) Select(field string, fields ...string) *NetInterfaceSelect

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 {
	InterfaceName string `json:"interface_name,omitempty"`
}

client.NetInterface.Query().
	Select(netinterface.FieldInterfaceName).
	Scan(ctx, &v)

func (*NetInterfaceQuery) Unique

func (niq *NetInterfaceQuery) Unique(unique bool) *NetInterfaceQuery

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 (*NetInterfaceQuery) Where

Where adds a new predicate for the NetInterfaceQuery builder.

func (*NetInterfaceQuery) WithHaveVlans

func (niq *NetInterfaceQuery) WithHaveVlans(opts ...func(*VlanQuery)) *NetInterfaceQuery

WithHaveVlans tells the query-builder to eager-load the nodes that are connected to the "have_vlans" edge. The optional arguments are used to configure the query builder of the edge.

func (*NetInterfaceQuery) WithIPStaticRouting added in v0.2.0

func (niq *NetInterfaceQuery) WithIPStaticRouting(opts ...func(*IPStaticRoutingTableQuery)) *NetInterfaceQuery

WithIPStaticRouting tells the query-builder to eager-load the nodes that are connected to the "ip_static_routing" edge. The optional arguments are used to configure the query builder of the edge.

func (*NetInterfaceQuery) WithMode

func (niq *NetInterfaceQuery) WithMode(opts ...func(*NetInterfaceModeQuery)) *NetInterfaceQuery

WithMode tells the query-builder to eager-load the nodes that are connected to the "mode" edge. The optional arguments are used to configure the query builder of the edge.

func (*NetInterfaceQuery) WithNativeOnVlan

func (niq *NetInterfaceQuery) WithNativeOnVlan(opts ...func(*VlanQuery)) *NetInterfaceQuery

WithNativeOnVlan tells the query-builder to eager-load the nodes that are connected to the "native_on_vlan" edge. The optional arguments are used to configure the query builder of the edge.

func (*NetInterfaceQuery) WithOnDevice

func (niq *NetInterfaceQuery) WithOnDevice(opts ...func(*DeviceQuery)) *NetInterfaceQuery

WithOnDevice tells the query-builder to eager-load the nodes that are connected to the "on_device" edge. The optional arguments are used to configure the query builder of the edge.

func (*NetInterfaceQuery) WithOnIPAddress added in v0.2.0

func (niq *NetInterfaceQuery) WithOnIPAddress(opts ...func(*IPAddressQuery)) *NetInterfaceQuery

WithOnIPAddress tells the query-builder to eager-load the nodes that are connected to the "on_ip_address" edge. The optional arguments are used to configure the query builder of the edge.

func (*NetInterfaceQuery) WithOnLayer added in v0.2.0

func (niq *NetInterfaceQuery) WithOnLayer(opts ...func(*NetInterfaceLayerQuery)) *NetInterfaceQuery

WithOnLayer tells the query-builder to eager-load the nodes that are connected to the "on_layer" edge. The optional arguments are used to configure the query builder of the edge.

func (*NetInterfaceQuery) WithOnPoInterface added in v0.2.0

func (niq *NetInterfaceQuery) WithOnPoInterface(opts ...func(*PortChannelInterfaceQuery)) *NetInterfaceQuery

WithOnPoInterface tells the query-builder to eager-load the nodes that are connected to the "on_po_interface" edge. The optional arguments are used to configure the query builder of the edge.

type NetInterfaceSelect

type NetInterfaceSelect struct {
	*NetInterfaceQuery
	// contains filtered or unexported fields
}

NetInterfaceSelect is the builder for selecting fields of NetInterface entities.

func (*NetInterfaceSelect) Bool

func (nis *NetInterfaceSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*NetInterfaceSelect) BoolX

func (nis *NetInterfaceSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*NetInterfaceSelect) Bools

func (nis *NetInterfaceSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*NetInterfaceSelect) BoolsX

func (nis *NetInterfaceSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*NetInterfaceSelect) Float64

func (nis *NetInterfaceSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*NetInterfaceSelect) Float64X

func (nis *NetInterfaceSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*NetInterfaceSelect) Float64s

func (nis *NetInterfaceSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*NetInterfaceSelect) Float64sX

func (nis *NetInterfaceSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*NetInterfaceSelect) Int

func (nis *NetInterfaceSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*NetInterfaceSelect) IntX

func (nis *NetInterfaceSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*NetInterfaceSelect) Ints

func (nis *NetInterfaceSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*NetInterfaceSelect) IntsX

func (nis *NetInterfaceSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*NetInterfaceSelect) Scan

func (nis *NetInterfaceSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*NetInterfaceSelect) ScanX

func (nis *NetInterfaceSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*NetInterfaceSelect) String

func (nis *NetInterfaceSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*NetInterfaceSelect) StringX

func (nis *NetInterfaceSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*NetInterfaceSelect) Strings

func (nis *NetInterfaceSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*NetInterfaceSelect) StringsX

func (nis *NetInterfaceSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type NetInterfaceUpdate

type NetInterfaceUpdate struct {
	// contains filtered or unexported fields
}

NetInterfaceUpdate is the builder for updating NetInterface entities.

func (*NetInterfaceUpdate) AddHaveVlanIDs

func (niu *NetInterfaceUpdate) AddHaveVlanIDs(ids ...int) *NetInterfaceUpdate

AddHaveVlanIDs adds the "have_vlans" edge to the Vlan entity by IDs.

func (*NetInterfaceUpdate) AddHaveVlans

func (niu *NetInterfaceUpdate) AddHaveVlans(v ...*Vlan) *NetInterfaceUpdate

AddHaveVlans adds the "have_vlans" edges to the Vlan entity.

func (*NetInterfaceUpdate) AddIPStaticRouting added in v0.2.0

func (niu *NetInterfaceUpdate) AddIPStaticRouting(i ...*IPStaticRoutingTable) *NetInterfaceUpdate

AddIPStaticRouting adds the "ip_static_routing" edges to the IPStaticRoutingTable entity.

func (*NetInterfaceUpdate) AddIPStaticRoutingIDs added in v0.2.0

func (niu *NetInterfaceUpdate) AddIPStaticRoutingIDs(ids ...int) *NetInterfaceUpdate

AddIPStaticRoutingIDs adds the "ip_static_routing" edge to the IPStaticRoutingTable entity by IDs.

func (*NetInterfaceUpdate) ClearHaveVlans

func (niu *NetInterfaceUpdate) ClearHaveVlans() *NetInterfaceUpdate

ClearHaveVlans clears all "have_vlans" edges to the Vlan entity.

func (*NetInterfaceUpdate) ClearIPStaticRouting added in v0.2.0

func (niu *NetInterfaceUpdate) ClearIPStaticRouting() *NetInterfaceUpdate

ClearIPStaticRouting clears all "ip_static_routing" edges to the IPStaticRoutingTable entity.

func (*NetInterfaceUpdate) ClearMode

func (niu *NetInterfaceUpdate) ClearMode() *NetInterfaceUpdate

ClearMode clears the "mode" edge to the NetInterfaceMode entity.

func (*NetInterfaceUpdate) ClearNativeOnVlan

func (niu *NetInterfaceUpdate) ClearNativeOnVlan() *NetInterfaceUpdate

ClearNativeOnVlan clears the "native_on_vlan" edge to the Vlan entity.

func (*NetInterfaceUpdate) ClearOnDevice

func (niu *NetInterfaceUpdate) ClearOnDevice() *NetInterfaceUpdate

ClearOnDevice clears the "on_device" edge to the Device entity.

func (*NetInterfaceUpdate) ClearOnIPAddress added in v0.2.0

func (niu *NetInterfaceUpdate) ClearOnIPAddress() *NetInterfaceUpdate

ClearOnIPAddress clears the "on_ip_address" edge to the IPAddress entity.

func (*NetInterfaceUpdate) ClearOnLayer added in v0.2.0

func (niu *NetInterfaceUpdate) ClearOnLayer() *NetInterfaceUpdate

ClearOnLayer clears the "on_layer" edge to the NetInterfaceLayer entity.

func (*NetInterfaceUpdate) ClearOnPoInterface added in v0.2.0

func (niu *NetInterfaceUpdate) ClearOnPoInterface() *NetInterfaceUpdate

ClearOnPoInterface clears the "on_po_interface" edge to the PortChannelInterface entity.

func (*NetInterfaceUpdate) Exec

func (niu *NetInterfaceUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*NetInterfaceUpdate) ExecX

func (niu *NetInterfaceUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NetInterfaceUpdate) Mutation

func (niu *NetInterfaceUpdate) Mutation() *NetInterfaceMutation

Mutation returns the NetInterfaceMutation object of the builder.

func (*NetInterfaceUpdate) RemoveHaveVlanIDs

func (niu *NetInterfaceUpdate) RemoveHaveVlanIDs(ids ...int) *NetInterfaceUpdate

RemoveHaveVlanIDs removes the "have_vlans" edge to Vlan entities by IDs.

func (*NetInterfaceUpdate) RemoveHaveVlans

func (niu *NetInterfaceUpdate) RemoveHaveVlans(v ...*Vlan) *NetInterfaceUpdate

RemoveHaveVlans removes "have_vlans" edges to Vlan entities.

func (*NetInterfaceUpdate) RemoveIPStaticRouting added in v0.2.0

func (niu *NetInterfaceUpdate) RemoveIPStaticRouting(i ...*IPStaticRoutingTable) *NetInterfaceUpdate

RemoveIPStaticRouting removes "ip_static_routing" edges to IPStaticRoutingTable entities.

func (*NetInterfaceUpdate) RemoveIPStaticRoutingIDs added in v0.2.0

func (niu *NetInterfaceUpdate) RemoveIPStaticRoutingIDs(ids ...int) *NetInterfaceUpdate

RemoveIPStaticRoutingIDs removes the "ip_static_routing" edge to IPStaticRoutingTable entities by IDs.

func (*NetInterfaceUpdate) Save

func (niu *NetInterfaceUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*NetInterfaceUpdate) SaveX

func (niu *NetInterfaceUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*NetInterfaceUpdate) SetInterfaceName

func (niu *NetInterfaceUpdate) SetInterfaceName(s string) *NetInterfaceUpdate

SetInterfaceName sets the "interface_name" field.

func (*NetInterfaceUpdate) SetInterfaceShutdown

func (niu *NetInterfaceUpdate) SetInterfaceShutdown(b bool) *NetInterfaceUpdate

SetInterfaceShutdown sets the "interface_shutdown" field.

func (*NetInterfaceUpdate) SetMode

SetMode sets the "mode" edge to the NetInterfaceMode entity.

func (*NetInterfaceUpdate) SetModeID

func (niu *NetInterfaceUpdate) SetModeID(id int) *NetInterfaceUpdate

SetModeID sets the "mode" edge to the NetInterfaceMode entity by ID.

func (*NetInterfaceUpdate) SetNativeOnVlan

func (niu *NetInterfaceUpdate) SetNativeOnVlan(v *Vlan) *NetInterfaceUpdate

SetNativeOnVlan sets the "native_on_vlan" edge to the Vlan entity.

func (*NetInterfaceUpdate) SetNativeOnVlanID

func (niu *NetInterfaceUpdate) SetNativeOnVlanID(id int) *NetInterfaceUpdate

SetNativeOnVlanID sets the "native_on_vlan" edge to the Vlan entity by ID.

func (*NetInterfaceUpdate) SetNillableInterfaceShutdown

func (niu *NetInterfaceUpdate) SetNillableInterfaceShutdown(b *bool) *NetInterfaceUpdate

SetNillableInterfaceShutdown sets the "interface_shutdown" field if the given value is not nil.

func (*NetInterfaceUpdate) SetNillableModeID

func (niu *NetInterfaceUpdate) SetNillableModeID(id *int) *NetInterfaceUpdate

SetNillableModeID sets the "mode" edge to the NetInterfaceMode entity by ID if the given value is not nil.

func (*NetInterfaceUpdate) SetNillableNativeOnVlanID

func (niu *NetInterfaceUpdate) SetNillableNativeOnVlanID(id *int) *NetInterfaceUpdate

SetNillableNativeOnVlanID sets the "native_on_vlan" edge to the Vlan entity by ID if the given value is not nil.

func (*NetInterfaceUpdate) SetNillableOnDeviceID

func (niu *NetInterfaceUpdate) SetNillableOnDeviceID(id *int) *NetInterfaceUpdate

SetNillableOnDeviceID sets the "on_device" edge to the Device entity by ID if the given value is not nil.

func (*NetInterfaceUpdate) SetNillableOnIPAddressID added in v0.2.0

func (niu *NetInterfaceUpdate) SetNillableOnIPAddressID(id *int) *NetInterfaceUpdate

SetNillableOnIPAddressID sets the "on_ip_address" edge to the IPAddress entity by ID if the given value is not nil.

func (*NetInterfaceUpdate) SetNillableOnLayerID added in v0.2.0

func (niu *NetInterfaceUpdate) SetNillableOnLayerID(id *int) *NetInterfaceUpdate

SetNillableOnLayerID sets the "on_layer" edge to the NetInterfaceLayer entity by ID if the given value is not nil.

func (*NetInterfaceUpdate) SetNillableOnPoInterfaceID added in v0.2.0

func (niu *NetInterfaceUpdate) SetNillableOnPoInterfaceID(id *int) *NetInterfaceUpdate

SetNillableOnPoInterfaceID sets the "on_po_interface" edge to the PortChannelInterface entity by ID if the given value is not nil.

func (*NetInterfaceUpdate) SetOnDevice

func (niu *NetInterfaceUpdate) SetOnDevice(d *Device) *NetInterfaceUpdate

SetOnDevice sets the "on_device" edge to the Device entity.

func (*NetInterfaceUpdate) SetOnDeviceID

func (niu *NetInterfaceUpdate) SetOnDeviceID(id int) *NetInterfaceUpdate

SetOnDeviceID sets the "on_device" edge to the Device entity by ID.

func (*NetInterfaceUpdate) SetOnIPAddress added in v0.2.0

func (niu *NetInterfaceUpdate) SetOnIPAddress(i *IPAddress) *NetInterfaceUpdate

SetOnIPAddress sets the "on_ip_address" edge to the IPAddress entity.

func (*NetInterfaceUpdate) SetOnIPAddressID added in v0.2.0

func (niu *NetInterfaceUpdate) SetOnIPAddressID(id int) *NetInterfaceUpdate

SetOnIPAddressID sets the "on_ip_address" edge to the IPAddress entity by ID.

func (*NetInterfaceUpdate) SetOnLayer added in v0.2.0

SetOnLayer sets the "on_layer" edge to the NetInterfaceLayer entity.

func (*NetInterfaceUpdate) SetOnLayerID added in v0.2.0

func (niu *NetInterfaceUpdate) SetOnLayerID(id int) *NetInterfaceUpdate

SetOnLayerID sets the "on_layer" edge to the NetInterfaceLayer entity by ID.

func (*NetInterfaceUpdate) SetOnPoInterface added in v0.2.0

func (niu *NetInterfaceUpdate) SetOnPoInterface(p *PortChannelInterface) *NetInterfaceUpdate

SetOnPoInterface sets the "on_po_interface" edge to the PortChannelInterface entity.

func (*NetInterfaceUpdate) SetOnPoInterfaceID added in v0.2.0

func (niu *NetInterfaceUpdate) SetOnPoInterfaceID(id int) *NetInterfaceUpdate

SetOnPoInterfaceID sets the "on_po_interface" edge to the PortChannelInterface entity by ID.

func (*NetInterfaceUpdate) Where

Where adds a new predicate for the NetInterfaceUpdate builder.

type NetInterfaceUpdateOne

type NetInterfaceUpdateOne struct {
	// contains filtered or unexported fields
}

NetInterfaceUpdateOne is the builder for updating a single NetInterface entity.

func (*NetInterfaceUpdateOne) AddHaveVlanIDs

func (niuo *NetInterfaceUpdateOne) AddHaveVlanIDs(ids ...int) *NetInterfaceUpdateOne

AddHaveVlanIDs adds the "have_vlans" edge to the Vlan entity by IDs.

func (*NetInterfaceUpdateOne) AddHaveVlans

func (niuo *NetInterfaceUpdateOne) AddHaveVlans(v ...*Vlan) *NetInterfaceUpdateOne

AddHaveVlans adds the "have_vlans" edges to the Vlan entity.

func (*NetInterfaceUpdateOne) AddIPStaticRouting added in v0.2.0

func (niuo *NetInterfaceUpdateOne) AddIPStaticRouting(i ...*IPStaticRoutingTable) *NetInterfaceUpdateOne

AddIPStaticRouting adds the "ip_static_routing" edges to the IPStaticRoutingTable entity.

func (*NetInterfaceUpdateOne) AddIPStaticRoutingIDs added in v0.2.0

func (niuo *NetInterfaceUpdateOne) AddIPStaticRoutingIDs(ids ...int) *NetInterfaceUpdateOne

AddIPStaticRoutingIDs adds the "ip_static_routing" edge to the IPStaticRoutingTable entity by IDs.

func (*NetInterfaceUpdateOne) ClearHaveVlans

func (niuo *NetInterfaceUpdateOne) ClearHaveVlans() *NetInterfaceUpdateOne

ClearHaveVlans clears all "have_vlans" edges to the Vlan entity.

func (*NetInterfaceUpdateOne) ClearIPStaticRouting added in v0.2.0

func (niuo *NetInterfaceUpdateOne) ClearIPStaticRouting() *NetInterfaceUpdateOne

ClearIPStaticRouting clears all "ip_static_routing" edges to the IPStaticRoutingTable entity.

func (*NetInterfaceUpdateOne) ClearMode

func (niuo *NetInterfaceUpdateOne) ClearMode() *NetInterfaceUpdateOne

ClearMode clears the "mode" edge to the NetInterfaceMode entity.

func (*NetInterfaceUpdateOne) ClearNativeOnVlan

func (niuo *NetInterfaceUpdateOne) ClearNativeOnVlan() *NetInterfaceUpdateOne

ClearNativeOnVlan clears the "native_on_vlan" edge to the Vlan entity.

func (*NetInterfaceUpdateOne) ClearOnDevice

func (niuo *NetInterfaceUpdateOne) ClearOnDevice() *NetInterfaceUpdateOne

ClearOnDevice clears the "on_device" edge to the Device entity.

func (*NetInterfaceUpdateOne) ClearOnIPAddress added in v0.2.0

func (niuo *NetInterfaceUpdateOne) ClearOnIPAddress() *NetInterfaceUpdateOne

ClearOnIPAddress clears the "on_ip_address" edge to the IPAddress entity.

func (*NetInterfaceUpdateOne) ClearOnLayer added in v0.2.0

func (niuo *NetInterfaceUpdateOne) ClearOnLayer() *NetInterfaceUpdateOne

ClearOnLayer clears the "on_layer" edge to the NetInterfaceLayer entity.

func (*NetInterfaceUpdateOne) ClearOnPoInterface added in v0.2.0

func (niuo *NetInterfaceUpdateOne) ClearOnPoInterface() *NetInterfaceUpdateOne

ClearOnPoInterface clears the "on_po_interface" edge to the PortChannelInterface entity.

func (*NetInterfaceUpdateOne) Exec

func (niuo *NetInterfaceUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*NetInterfaceUpdateOne) ExecX

func (niuo *NetInterfaceUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NetInterfaceUpdateOne) Mutation

func (niuo *NetInterfaceUpdateOne) Mutation() *NetInterfaceMutation

Mutation returns the NetInterfaceMutation object of the builder.

func (*NetInterfaceUpdateOne) RemoveHaveVlanIDs

func (niuo *NetInterfaceUpdateOne) RemoveHaveVlanIDs(ids ...int) *NetInterfaceUpdateOne

RemoveHaveVlanIDs removes the "have_vlans" edge to Vlan entities by IDs.

func (*NetInterfaceUpdateOne) RemoveHaveVlans

func (niuo *NetInterfaceUpdateOne) RemoveHaveVlans(v ...*Vlan) *NetInterfaceUpdateOne

RemoveHaveVlans removes "have_vlans" edges to Vlan entities.

func (*NetInterfaceUpdateOne) RemoveIPStaticRouting added in v0.2.0

func (niuo *NetInterfaceUpdateOne) RemoveIPStaticRouting(i ...*IPStaticRoutingTable) *NetInterfaceUpdateOne

RemoveIPStaticRouting removes "ip_static_routing" edges to IPStaticRoutingTable entities.

func (*NetInterfaceUpdateOne) RemoveIPStaticRoutingIDs added in v0.2.0

func (niuo *NetInterfaceUpdateOne) RemoveIPStaticRoutingIDs(ids ...int) *NetInterfaceUpdateOne

RemoveIPStaticRoutingIDs removes the "ip_static_routing" edge to IPStaticRoutingTable entities by IDs.

func (*NetInterfaceUpdateOne) Save

Save executes the query and returns the updated NetInterface entity.

func (*NetInterfaceUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*NetInterfaceUpdateOne) Select

func (niuo *NetInterfaceUpdateOne) Select(field string, fields ...string) *NetInterfaceUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*NetInterfaceUpdateOne) SetInterfaceName

func (niuo *NetInterfaceUpdateOne) SetInterfaceName(s string) *NetInterfaceUpdateOne

SetInterfaceName sets the "interface_name" field.

func (*NetInterfaceUpdateOne) SetInterfaceShutdown

func (niuo *NetInterfaceUpdateOne) SetInterfaceShutdown(b bool) *NetInterfaceUpdateOne

SetInterfaceShutdown sets the "interface_shutdown" field.

func (*NetInterfaceUpdateOne) SetMode

SetMode sets the "mode" edge to the NetInterfaceMode entity.

func (*NetInterfaceUpdateOne) SetModeID

func (niuo *NetInterfaceUpdateOne) SetModeID(id int) *NetInterfaceUpdateOne

SetModeID sets the "mode" edge to the NetInterfaceMode entity by ID.

func (*NetInterfaceUpdateOne) SetNativeOnVlan

func (niuo *NetInterfaceUpdateOne) SetNativeOnVlan(v *Vlan) *NetInterfaceUpdateOne

SetNativeOnVlan sets the "native_on_vlan" edge to the Vlan entity.

func (*NetInterfaceUpdateOne) SetNativeOnVlanID

func (niuo *NetInterfaceUpdateOne) SetNativeOnVlanID(id int) *NetInterfaceUpdateOne

SetNativeOnVlanID sets the "native_on_vlan" edge to the Vlan entity by ID.

func (*NetInterfaceUpdateOne) SetNillableInterfaceShutdown

func (niuo *NetInterfaceUpdateOne) SetNillableInterfaceShutdown(b *bool) *NetInterfaceUpdateOne

SetNillableInterfaceShutdown sets the "interface_shutdown" field if the given value is not nil.

func (*NetInterfaceUpdateOne) SetNillableModeID

func (niuo *NetInterfaceUpdateOne) SetNillableModeID(id *int) *NetInterfaceUpdateOne

SetNillableModeID sets the "mode" edge to the NetInterfaceMode entity by ID if the given value is not nil.

func (*NetInterfaceUpdateOne) SetNillableNativeOnVlanID

func (niuo *NetInterfaceUpdateOne) SetNillableNativeOnVlanID(id *int) *NetInterfaceUpdateOne

SetNillableNativeOnVlanID sets the "native_on_vlan" edge to the Vlan entity by ID if the given value is not nil.

func (*NetInterfaceUpdateOne) SetNillableOnDeviceID

func (niuo *NetInterfaceUpdateOne) SetNillableOnDeviceID(id *int) *NetInterfaceUpdateOne

SetNillableOnDeviceID sets the "on_device" edge to the Device entity by ID if the given value is not nil.

func (*NetInterfaceUpdateOne) SetNillableOnIPAddressID added in v0.2.0

func (niuo *NetInterfaceUpdateOne) SetNillableOnIPAddressID(id *int) *NetInterfaceUpdateOne

SetNillableOnIPAddressID sets the "on_ip_address" edge to the IPAddress entity by ID if the given value is not nil.

func (*NetInterfaceUpdateOne) SetNillableOnLayerID added in v0.2.0

func (niuo *NetInterfaceUpdateOne) SetNillableOnLayerID(id *int) *NetInterfaceUpdateOne

SetNillableOnLayerID sets the "on_layer" edge to the NetInterfaceLayer entity by ID if the given value is not nil.

func (*NetInterfaceUpdateOne) SetNillableOnPoInterfaceID added in v0.2.0

func (niuo *NetInterfaceUpdateOne) SetNillableOnPoInterfaceID(id *int) *NetInterfaceUpdateOne

SetNillableOnPoInterfaceID sets the "on_po_interface" edge to the PortChannelInterface entity by ID if the given value is not nil.

func (*NetInterfaceUpdateOne) SetOnDevice

func (niuo *NetInterfaceUpdateOne) SetOnDevice(d *Device) *NetInterfaceUpdateOne

SetOnDevice sets the "on_device" edge to the Device entity.

func (*NetInterfaceUpdateOne) SetOnDeviceID

func (niuo *NetInterfaceUpdateOne) SetOnDeviceID(id int) *NetInterfaceUpdateOne

SetOnDeviceID sets the "on_device" edge to the Device entity by ID.

func (*NetInterfaceUpdateOne) SetOnIPAddress added in v0.2.0

func (niuo *NetInterfaceUpdateOne) SetOnIPAddress(i *IPAddress) *NetInterfaceUpdateOne

SetOnIPAddress sets the "on_ip_address" edge to the IPAddress entity.

func (*NetInterfaceUpdateOne) SetOnIPAddressID added in v0.2.0

func (niuo *NetInterfaceUpdateOne) SetOnIPAddressID(id int) *NetInterfaceUpdateOne

SetOnIPAddressID sets the "on_ip_address" edge to the IPAddress entity by ID.

func (*NetInterfaceUpdateOne) SetOnLayer added in v0.2.0

SetOnLayer sets the "on_layer" edge to the NetInterfaceLayer entity.

func (*NetInterfaceUpdateOne) SetOnLayerID added in v0.2.0

func (niuo *NetInterfaceUpdateOne) SetOnLayerID(id int) *NetInterfaceUpdateOne

SetOnLayerID sets the "on_layer" edge to the NetInterfaceLayer entity by ID.

func (*NetInterfaceUpdateOne) SetOnPoInterface added in v0.2.0

SetOnPoInterface sets the "on_po_interface" edge to the PortChannelInterface entity.

func (*NetInterfaceUpdateOne) SetOnPoInterfaceID added in v0.2.0

func (niuo *NetInterfaceUpdateOne) SetOnPoInterfaceID(id int) *NetInterfaceUpdateOne

SetOnPoInterfaceID sets the "on_po_interface" edge to the PortChannelInterface entity by ID.

type NetInterfaces

type NetInterfaces []*NetInterface

NetInterfaces is a parsable slice of NetInterface.

type NetTopologies

type NetTopologies []*NetTopology

NetTopologies is a parsable slice of NetTopology.

type NetTopology

type NetTopology struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// TopologyName holds the value of the "topology_name" field.
	TopologyName string `json:"topology_name,omitempty"`
	// TopologyDescription holds the value of the "topology_description" field.
	TopologyDescription string `json:"topology_description,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the NetTopologyQuery when eager-loading is set.
	Edges NetTopologyEdges `json:"edges"`
	// contains filtered or unexported fields
}

NetTopology is the model entity for the NetTopology schema.

func (*NetTopology) QueryTopology

func (nt *NetTopology) QueryTopology() *NetTopologyDeviceMapQuery

QueryTopology queries the "topology" edge of the NetTopology entity.

func (*NetTopology) String

func (nt *NetTopology) String() string

String implements the fmt.Stringer.

func (*NetTopology) Unwrap

func (nt *NetTopology) Unwrap() *NetTopology

Unwrap unwraps the NetTopology 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 (*NetTopology) Update

func (nt *NetTopology) Update() *NetTopologyUpdateOne

Update returns a builder for updating this NetTopology. Note that you need to call NetTopology.Unwrap() before calling this method if this NetTopology was returned from a transaction, and the transaction was committed or rolled back.

type NetTopologyClient

type NetTopologyClient struct {
	// contains filtered or unexported fields
}

NetTopologyClient is a client for the NetTopology schema.

func NewNetTopologyClient

func NewNetTopologyClient(c config) *NetTopologyClient

NewNetTopologyClient returns a client for the NetTopology from the given config.

func (*NetTopologyClient) Create

func (c *NetTopologyClient) Create() *NetTopologyCreate

Create returns a create builder for NetTopology.

func (*NetTopologyClient) CreateBulk

func (c *NetTopologyClient) CreateBulk(builders ...*NetTopologyCreate) *NetTopologyCreateBulk

CreateBulk returns a builder for creating a bulk of NetTopology entities.

func (*NetTopologyClient) Delete

func (c *NetTopologyClient) Delete() *NetTopologyDelete

Delete returns a delete builder for NetTopology.

func (*NetTopologyClient) DeleteOne

DeleteOne returns a delete builder for the given entity.

func (*NetTopologyClient) DeleteOneID

func (c *NetTopologyClient) DeleteOneID(id int) *NetTopologyDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*NetTopologyClient) Get

func (c *NetTopologyClient) Get(ctx context.Context, id int) (*NetTopology, error)

Get returns a NetTopology entity by its id.

func (*NetTopologyClient) GetX

func (c *NetTopologyClient) GetX(ctx context.Context, id int) *NetTopology

GetX is like Get, but panics if an error occurs.

func (*NetTopologyClient) Hooks

func (c *NetTopologyClient) Hooks() []Hook

Hooks returns the client hooks.

func (*NetTopologyClient) Query

func (c *NetTopologyClient) Query() *NetTopologyQuery

Query returns a query builder for NetTopology.

func (*NetTopologyClient) QueryTopology

QueryTopology queries the topology edge of a NetTopology.

func (*NetTopologyClient) Update

func (c *NetTopologyClient) Update() *NetTopologyUpdate

Update returns an update builder for NetTopology.

func (*NetTopologyClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*NetTopologyClient) UpdateOneID

func (c *NetTopologyClient) UpdateOneID(id int) *NetTopologyUpdateOne

UpdateOneID returns an update builder for the given id.

func (*NetTopologyClient) Use

func (c *NetTopologyClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `nettopology.Hooks(f(g(h())))`.

type NetTopologyCreate

type NetTopologyCreate struct {
	// contains filtered or unexported fields
}

NetTopologyCreate is the builder for creating a NetTopology entity.

func (*NetTopologyCreate) AddTopology

func (ntc *NetTopologyCreate) AddTopology(n ...*NetTopologyDeviceMap) *NetTopologyCreate

AddTopology adds the "topology" edges to the NetTopologyDeviceMap entity.

func (*NetTopologyCreate) AddTopologyIDs

func (ntc *NetTopologyCreate) AddTopologyIDs(ids ...int) *NetTopologyCreate

AddTopologyIDs adds the "topology" edge to the NetTopologyDeviceMap entity by IDs.

func (*NetTopologyCreate) Mutation

func (ntc *NetTopologyCreate) Mutation() *NetTopologyMutation

Mutation returns the NetTopologyMutation object of the builder.

func (*NetTopologyCreate) Save

func (ntc *NetTopologyCreate) Save(ctx context.Context) (*NetTopology, error)

Save creates the NetTopology in the database.

func (*NetTopologyCreate) SaveX

func (ntc *NetTopologyCreate) SaveX(ctx context.Context) *NetTopology

SaveX calls Save and panics if Save returns an error.

func (*NetTopologyCreate) SetTopologyDescription

func (ntc *NetTopologyCreate) SetTopologyDescription(s string) *NetTopologyCreate

SetTopologyDescription sets the "topology_description" field.

func (*NetTopologyCreate) SetTopologyName

func (ntc *NetTopologyCreate) SetTopologyName(s string) *NetTopologyCreate

SetTopologyName sets the "topology_name" field.

type NetTopologyCreateBulk

type NetTopologyCreateBulk struct {
	// contains filtered or unexported fields
}

NetTopologyCreateBulk is the builder for creating many NetTopology entities in bulk.

func (*NetTopologyCreateBulk) Save

func (ntcb *NetTopologyCreateBulk) Save(ctx context.Context) ([]*NetTopology, error)

Save creates the NetTopology entities in the database.

func (*NetTopologyCreateBulk) SaveX

func (ntcb *NetTopologyCreateBulk) SaveX(ctx context.Context) []*NetTopology

SaveX is like Save, but panics if an error occurs.

type NetTopologyDelete

type NetTopologyDelete struct {
	// contains filtered or unexported fields
}

NetTopologyDelete is the builder for deleting a NetTopology entity.

func (*NetTopologyDelete) Exec

func (ntd *NetTopologyDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*NetTopologyDelete) ExecX

func (ntd *NetTopologyDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*NetTopologyDelete) Where

Where adds a new predicate to the NetTopologyDelete builder.

type NetTopologyDeleteOne

type NetTopologyDeleteOne struct {
	// contains filtered or unexported fields
}

NetTopologyDeleteOne is the builder for deleting a single NetTopology entity.

func (*NetTopologyDeleteOne) Exec

func (ntdo *NetTopologyDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*NetTopologyDeleteOne) ExecX

func (ntdo *NetTopologyDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type NetTopologyDeviceMap

type NetTopologyDeviceMap struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// PositionX holds the value of the "position_x" field.
	PositionX int `json:"position_x,omitempty"`
	// PositionY holds the value of the "position_y" field.
	PositionY int `json:"position_y,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the NetTopologyDeviceMapQuery when eager-loading is set.
	Edges NetTopologyDeviceMapEdges `json:"edges"`
	// contains filtered or unexported fields
}

NetTopologyDeviceMap is the model entity for the NetTopologyDeviceMap schema.

func (*NetTopologyDeviceMap) QueryDevice

func (ntdm *NetTopologyDeviceMap) QueryDevice() *DeviceQuery

QueryDevice queries the "device" edge of the NetTopologyDeviceMap entity.

func (*NetTopologyDeviceMap) QueryEdge

QueryEdge queries the "edge" edge of the NetTopologyDeviceMap entity.

func (*NetTopologyDeviceMap) QueryOnTopology

func (ntdm *NetTopologyDeviceMap) QueryOnTopology() *NetTopologyQuery

QueryOnTopology queries the "on_topology" edge of the NetTopologyDeviceMap entity.

func (*NetTopologyDeviceMap) String

func (ntdm *NetTopologyDeviceMap) String() string

String implements the fmt.Stringer.

func (*NetTopologyDeviceMap) Unwrap

Unwrap unwraps the NetTopologyDeviceMap 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 (*NetTopologyDeviceMap) Update

Update returns a builder for updating this NetTopologyDeviceMap. Note that you need to call NetTopologyDeviceMap.Unwrap() before calling this method if this NetTopologyDeviceMap was returned from a transaction, and the transaction was committed or rolled back.

type NetTopologyDeviceMapClient

type NetTopologyDeviceMapClient struct {
	// contains filtered or unexported fields
}

NetTopologyDeviceMapClient is a client for the NetTopologyDeviceMap schema.

func NewNetTopologyDeviceMapClient

func NewNetTopologyDeviceMapClient(c config) *NetTopologyDeviceMapClient

NewNetTopologyDeviceMapClient returns a client for the NetTopologyDeviceMap from the given config.

func (*NetTopologyDeviceMapClient) Create

Create returns a create builder for NetTopologyDeviceMap.

func (*NetTopologyDeviceMapClient) CreateBulk

CreateBulk returns a builder for creating a bulk of NetTopologyDeviceMap entities.

func (*NetTopologyDeviceMapClient) Delete

Delete returns a delete builder for NetTopologyDeviceMap.

func (*NetTopologyDeviceMapClient) DeleteOne

DeleteOne returns a delete builder for the given entity.

func (*NetTopologyDeviceMapClient) DeleteOneID

DeleteOneID returns a delete builder for the given id.

func (*NetTopologyDeviceMapClient) Get

Get returns a NetTopologyDeviceMap entity by its id.

func (*NetTopologyDeviceMapClient) GetX

GetX is like Get, but panics if an error occurs.

func (*NetTopologyDeviceMapClient) Hooks

func (c *NetTopologyDeviceMapClient) Hooks() []Hook

Hooks returns the client hooks.

func (*NetTopologyDeviceMapClient) Query

Query returns a query builder for NetTopologyDeviceMap.

func (*NetTopologyDeviceMapClient) QueryDevice

QueryDevice queries the device edge of a NetTopologyDeviceMap.

func (*NetTopologyDeviceMapClient) QueryEdge

QueryEdge queries the edge edge of a NetTopologyDeviceMap.

func (*NetTopologyDeviceMapClient) QueryOnTopology

QueryOnTopology queries the on_topology edge of a NetTopologyDeviceMap.

func (*NetTopologyDeviceMapClient) Update

Update returns an update builder for NetTopologyDeviceMap.

func (*NetTopologyDeviceMapClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*NetTopologyDeviceMapClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*NetTopologyDeviceMapClient) Use

func (c *NetTopologyDeviceMapClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `nettopologydevicemap.Hooks(f(g(h())))`.

type NetTopologyDeviceMapCreate

type NetTopologyDeviceMapCreate struct {
	// contains filtered or unexported fields
}

NetTopologyDeviceMapCreate is the builder for creating a NetTopologyDeviceMap entity.

func (*NetTopologyDeviceMapCreate) AddEdge

AddEdge adds the "edge" edges to the NetTopologyDeviceMap entity.

func (*NetTopologyDeviceMapCreate) AddEdgeIDs

func (ntdmc *NetTopologyDeviceMapCreate) AddEdgeIDs(ids ...int) *NetTopologyDeviceMapCreate

AddEdgeIDs adds the "edge" edge to the NetTopologyDeviceMap entity by IDs.

func (*NetTopologyDeviceMapCreate) Mutation

Mutation returns the NetTopologyDeviceMapMutation object of the builder.

func (*NetTopologyDeviceMapCreate) Save

Save creates the NetTopologyDeviceMap in the database.

func (*NetTopologyDeviceMapCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*NetTopologyDeviceMapCreate) SetDevice

SetDevice sets the "device" edge to the Device entity.

func (*NetTopologyDeviceMapCreate) SetDeviceID

SetDeviceID sets the "device" edge to the Device entity by ID.

func (*NetTopologyDeviceMapCreate) SetNillableDeviceID

func (ntdmc *NetTopologyDeviceMapCreate) SetNillableDeviceID(id *int) *NetTopologyDeviceMapCreate

SetNillableDeviceID sets the "device" edge to the Device entity by ID if the given value is not nil.

func (*NetTopologyDeviceMapCreate) SetNillableOnTopologyID

func (ntdmc *NetTopologyDeviceMapCreate) SetNillableOnTopologyID(id *int) *NetTopologyDeviceMapCreate

SetNillableOnTopologyID sets the "on_topology" edge to the NetTopology entity by ID if the given value is not nil.

func (*NetTopologyDeviceMapCreate) SetNillablePositionX

func (ntdmc *NetTopologyDeviceMapCreate) SetNillablePositionX(i *int) *NetTopologyDeviceMapCreate

SetNillablePositionX sets the "position_x" field if the given value is not nil.

func (*NetTopologyDeviceMapCreate) SetNillablePositionY

func (ntdmc *NetTopologyDeviceMapCreate) SetNillablePositionY(i *int) *NetTopologyDeviceMapCreate

SetNillablePositionY sets the "position_y" field if the given value is not nil.

func (*NetTopologyDeviceMapCreate) SetOnTopology

SetOnTopology sets the "on_topology" edge to the NetTopology entity.

func (*NetTopologyDeviceMapCreate) SetOnTopologyID

func (ntdmc *NetTopologyDeviceMapCreate) SetOnTopologyID(id int) *NetTopologyDeviceMapCreate

SetOnTopologyID sets the "on_topology" edge to the NetTopology entity by ID.

func (*NetTopologyDeviceMapCreate) SetPositionX

SetPositionX sets the "position_x" field.

func (*NetTopologyDeviceMapCreate) SetPositionY

SetPositionY sets the "position_y" field.

type NetTopologyDeviceMapCreateBulk

type NetTopologyDeviceMapCreateBulk struct {
	// contains filtered or unexported fields
}

NetTopologyDeviceMapCreateBulk is the builder for creating many NetTopologyDeviceMap entities in bulk.

func (*NetTopologyDeviceMapCreateBulk) Save

Save creates the NetTopologyDeviceMap entities in the database.

func (*NetTopologyDeviceMapCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type NetTopologyDeviceMapDelete

type NetTopologyDeviceMapDelete struct {
	// contains filtered or unexported fields
}

NetTopologyDeviceMapDelete is the builder for deleting a NetTopologyDeviceMap entity.

func (*NetTopologyDeviceMapDelete) Exec

func (ntdmd *NetTopologyDeviceMapDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*NetTopologyDeviceMapDelete) ExecX

func (ntdmd *NetTopologyDeviceMapDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*NetTopologyDeviceMapDelete) Where

Where adds a new predicate to the NetTopologyDeviceMapDelete builder.

type NetTopologyDeviceMapDeleteOne

type NetTopologyDeviceMapDeleteOne struct {
	// contains filtered or unexported fields
}

NetTopologyDeviceMapDeleteOne is the builder for deleting a single NetTopologyDeviceMap entity.

func (*NetTopologyDeviceMapDeleteOne) Exec

Exec executes the deletion query.

func (*NetTopologyDeviceMapDeleteOne) ExecX

func (ntdmdo *NetTopologyDeviceMapDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type NetTopologyDeviceMapEdges

type NetTopologyDeviceMapEdges struct {
	// OnTopology holds the value of the on_topology edge.
	OnTopology *NetTopology `json:"on_topology,omitempty"`
	// Device holds the value of the device edge.
	Device *Device `json:"device,omitempty"`
	// Edge holds the value of the edge edge.
	Edge []*NetTopologyDeviceMap `json:"edge,omitempty"`
	// contains filtered or unexported fields
}

NetTopologyDeviceMapEdges holds the relations/edges for other nodes in the graph.

func (NetTopologyDeviceMapEdges) DeviceOrErr

func (e NetTopologyDeviceMapEdges) DeviceOrErr() (*Device, error)

DeviceOrErr returns the Device value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (NetTopologyDeviceMapEdges) EdgeOrErr

EdgeOrErr returns the Edge value or an error if the edge was not loaded in eager-loading.

func (NetTopologyDeviceMapEdges) OnTopologyOrErr

func (e NetTopologyDeviceMapEdges) OnTopologyOrErr() (*NetTopology, error)

OnTopologyOrErr returns the OnTopology value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type NetTopologyDeviceMapGroupBy

type NetTopologyDeviceMapGroupBy struct {
	// contains filtered or unexported fields
}

NetTopologyDeviceMapGroupBy is the group-by builder for NetTopologyDeviceMap entities.

func (*NetTopologyDeviceMapGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*NetTopologyDeviceMapGroupBy) Bool

func (ntdmgb *NetTopologyDeviceMapGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*NetTopologyDeviceMapGroupBy) BoolX

func (ntdmgb *NetTopologyDeviceMapGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*NetTopologyDeviceMapGroupBy) Bools

func (ntdmgb *NetTopologyDeviceMapGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*NetTopologyDeviceMapGroupBy) BoolsX

func (ntdmgb *NetTopologyDeviceMapGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*NetTopologyDeviceMapGroupBy) Float64

func (ntdmgb *NetTopologyDeviceMapGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*NetTopologyDeviceMapGroupBy) Float64X

func (ntdmgb *NetTopologyDeviceMapGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*NetTopologyDeviceMapGroupBy) Float64s

func (ntdmgb *NetTopologyDeviceMapGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*NetTopologyDeviceMapGroupBy) Float64sX

func (ntdmgb *NetTopologyDeviceMapGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*NetTopologyDeviceMapGroupBy) Int

func (ntdmgb *NetTopologyDeviceMapGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*NetTopologyDeviceMapGroupBy) IntX

func (ntdmgb *NetTopologyDeviceMapGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*NetTopologyDeviceMapGroupBy) Ints

func (ntdmgb *NetTopologyDeviceMapGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*NetTopologyDeviceMapGroupBy) IntsX

func (ntdmgb *NetTopologyDeviceMapGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*NetTopologyDeviceMapGroupBy) Scan

func (ntdmgb *NetTopologyDeviceMapGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*NetTopologyDeviceMapGroupBy) ScanX

func (ntdmgb *NetTopologyDeviceMapGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*NetTopologyDeviceMapGroupBy) String

func (ntdmgb *NetTopologyDeviceMapGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*NetTopologyDeviceMapGroupBy) StringX

func (ntdmgb *NetTopologyDeviceMapGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*NetTopologyDeviceMapGroupBy) Strings

func (ntdmgb *NetTopologyDeviceMapGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*NetTopologyDeviceMapGroupBy) StringsX

func (ntdmgb *NetTopologyDeviceMapGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type NetTopologyDeviceMapMutation

type NetTopologyDeviceMapMutation struct {
	// contains filtered or unexported fields
}

NetTopologyDeviceMapMutation represents an operation that mutates the NetTopologyDeviceMap nodes in the graph.

func (*NetTopologyDeviceMapMutation) AddEdgeIDs

func (m *NetTopologyDeviceMapMutation) AddEdgeIDs(ids ...int)

AddEdgeIDs adds the "edge" edge to the NetTopologyDeviceMap entity by ids.

func (*NetTopologyDeviceMapMutation) AddField

func (m *NetTopologyDeviceMapMutation) 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 (*NetTopologyDeviceMapMutation) AddPositionX

func (m *NetTopologyDeviceMapMutation) AddPositionX(i int)

AddPositionX adds i to the "position_x" field.

func (*NetTopologyDeviceMapMutation) AddPositionY

func (m *NetTopologyDeviceMapMutation) AddPositionY(i int)

AddPositionY adds i to the "position_y" field.

func (*NetTopologyDeviceMapMutation) AddedEdges

func (m *NetTopologyDeviceMapMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*NetTopologyDeviceMapMutation) AddedField

func (m *NetTopologyDeviceMapMutation) 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 (*NetTopologyDeviceMapMutation) AddedFields

func (m *NetTopologyDeviceMapMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*NetTopologyDeviceMapMutation) AddedIDs

func (m *NetTopologyDeviceMapMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*NetTopologyDeviceMapMutation) AddedPositionX

func (m *NetTopologyDeviceMapMutation) AddedPositionX() (r int, exists bool)

AddedPositionX returns the value that was added to the "position_x" field in this mutation.

func (*NetTopologyDeviceMapMutation) AddedPositionY

func (m *NetTopologyDeviceMapMutation) AddedPositionY() (r int, exists bool)

AddedPositionY returns the value that was added to the "position_y" field in this mutation.

func (*NetTopologyDeviceMapMutation) ClearDevice

func (m *NetTopologyDeviceMapMutation) ClearDevice()

ClearDevice clears the "device" edge to the Device entity.

func (*NetTopologyDeviceMapMutation) ClearEdge

func (m *NetTopologyDeviceMapMutation) 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 (*NetTopologyDeviceMapMutation) ClearEdgeEdge

func (m *NetTopologyDeviceMapMutation) ClearEdgeEdge()

ClearEdgeEdge clears the "edge" edge to the NetTopologyDeviceMap entity.

func (*NetTopologyDeviceMapMutation) ClearField

func (m *NetTopologyDeviceMapMutation) 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 (*NetTopologyDeviceMapMutation) ClearOnTopology

func (m *NetTopologyDeviceMapMutation) ClearOnTopology()

ClearOnTopology clears the "on_topology" edge to the NetTopology entity.

func (*NetTopologyDeviceMapMutation) ClearedEdges

func (m *NetTopologyDeviceMapMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*NetTopologyDeviceMapMutation) ClearedFields

func (m *NetTopologyDeviceMapMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (NetTopologyDeviceMapMutation) 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 (*NetTopologyDeviceMapMutation) DeviceCleared

func (m *NetTopologyDeviceMapMutation) DeviceCleared() bool

DeviceCleared reports if the "device" edge to the Device entity was cleared.

func (*NetTopologyDeviceMapMutation) DeviceID

func (m *NetTopologyDeviceMapMutation) DeviceID() (id int, exists bool)

DeviceID returns the "device" edge ID in the mutation.

func (*NetTopologyDeviceMapMutation) DeviceIDs

func (m *NetTopologyDeviceMapMutation) DeviceIDs() (ids []int)

DeviceIDs returns the "device" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use DeviceID instead. It exists only for internal usage by the builders.

func (*NetTopologyDeviceMapMutation) EdgeCleared

func (m *NetTopologyDeviceMapMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*NetTopologyDeviceMapMutation) EdgeEdgeCleared

func (m *NetTopologyDeviceMapMutation) EdgeEdgeCleared() bool

EdgeEdgeCleared reports if the "edge" edge to the NetTopologyDeviceMap entity was cleared.

func (*NetTopologyDeviceMapMutation) EdgeIDs

func (m *NetTopologyDeviceMapMutation) EdgeIDs() (ids []int)

EdgeIDs returns the "edge" edge IDs in the mutation.

func (*NetTopologyDeviceMapMutation) Field

func (m *NetTopologyDeviceMapMutation) 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 (*NetTopologyDeviceMapMutation) FieldCleared

func (m *NetTopologyDeviceMapMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*NetTopologyDeviceMapMutation) Fields

func (m *NetTopologyDeviceMapMutation) 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 (*NetTopologyDeviceMapMutation) ID

func (m *NetTopologyDeviceMapMutation) 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.

func (*NetTopologyDeviceMapMutation) OldField

func (m *NetTopologyDeviceMapMutation) 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 (*NetTopologyDeviceMapMutation) OldPositionX

func (m *NetTopologyDeviceMapMutation) OldPositionX(ctx context.Context) (v int, err error)

OldPositionX returns the old "position_x" field's value of the NetTopologyDeviceMap entity. If the NetTopologyDeviceMap 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 (*NetTopologyDeviceMapMutation) OldPositionY

func (m *NetTopologyDeviceMapMutation) OldPositionY(ctx context.Context) (v int, err error)

OldPositionY returns the old "position_y" field's value of the NetTopologyDeviceMap entity. If the NetTopologyDeviceMap 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 (*NetTopologyDeviceMapMutation) OnTopologyCleared

func (m *NetTopologyDeviceMapMutation) OnTopologyCleared() bool

OnTopologyCleared reports if the "on_topology" edge to the NetTopology entity was cleared.

func (*NetTopologyDeviceMapMutation) OnTopologyID

func (m *NetTopologyDeviceMapMutation) OnTopologyID() (id int, exists bool)

OnTopologyID returns the "on_topology" edge ID in the mutation.

func (*NetTopologyDeviceMapMutation) OnTopologyIDs

func (m *NetTopologyDeviceMapMutation) OnTopologyIDs() (ids []int)

OnTopologyIDs returns the "on_topology" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use OnTopologyID instead. It exists only for internal usage by the builders.

func (*NetTopologyDeviceMapMutation) Op

Op returns the operation name.

func (*NetTopologyDeviceMapMutation) PositionX

func (m *NetTopologyDeviceMapMutation) PositionX() (r int, exists bool)

PositionX returns the value of the "position_x" field in the mutation.

func (*NetTopologyDeviceMapMutation) PositionY

func (m *NetTopologyDeviceMapMutation) PositionY() (r int, exists bool)

PositionY returns the value of the "position_y" field in the mutation.

func (*NetTopologyDeviceMapMutation) RemoveEdgeIDs

func (m *NetTopologyDeviceMapMutation) RemoveEdgeIDs(ids ...int)

RemoveEdgeIDs removes the "edge" edge to the NetTopologyDeviceMap entity by IDs.

func (*NetTopologyDeviceMapMutation) RemovedEdgeIDs

func (m *NetTopologyDeviceMapMutation) RemovedEdgeIDs() (ids []int)

RemovedEdge returns the removed IDs of the "edge" edge to the NetTopologyDeviceMap entity.

func (*NetTopologyDeviceMapMutation) RemovedEdges

func (m *NetTopologyDeviceMapMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*NetTopologyDeviceMapMutation) RemovedIDs

func (m *NetTopologyDeviceMapMutation) 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 (*NetTopologyDeviceMapMutation) ResetDevice

func (m *NetTopologyDeviceMapMutation) ResetDevice()

ResetDevice resets all changes to the "device" edge.

func (*NetTopologyDeviceMapMutation) ResetEdge

func (m *NetTopologyDeviceMapMutation) 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 (*NetTopologyDeviceMapMutation) ResetEdgeEdge

func (m *NetTopologyDeviceMapMutation) ResetEdgeEdge()

ResetEdgeEdge resets all changes to the "edge" edge.

func (*NetTopologyDeviceMapMutation) ResetField

func (m *NetTopologyDeviceMapMutation) 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 (*NetTopologyDeviceMapMutation) ResetOnTopology

func (m *NetTopologyDeviceMapMutation) ResetOnTopology()

ResetOnTopology resets all changes to the "on_topology" edge.

func (*NetTopologyDeviceMapMutation) ResetPositionX

func (m *NetTopologyDeviceMapMutation) ResetPositionX()

ResetPositionX resets all changes to the "position_x" field.

func (*NetTopologyDeviceMapMutation) ResetPositionY

func (m *NetTopologyDeviceMapMutation) ResetPositionY()

ResetPositionY resets all changes to the "position_y" field.

func (*NetTopologyDeviceMapMutation) SetDeviceID

func (m *NetTopologyDeviceMapMutation) SetDeviceID(id int)

SetDeviceID sets the "device" edge to the Device entity by id.

func (*NetTopologyDeviceMapMutation) SetField

func (m *NetTopologyDeviceMapMutation) 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 (*NetTopologyDeviceMapMutation) SetOnTopologyID

func (m *NetTopologyDeviceMapMutation) SetOnTopologyID(id int)

SetOnTopologyID sets the "on_topology" edge to the NetTopology entity by id.

func (*NetTopologyDeviceMapMutation) SetPositionX

func (m *NetTopologyDeviceMapMutation) SetPositionX(i int)

SetPositionX sets the "position_x" field.

func (*NetTopologyDeviceMapMutation) SetPositionY

func (m *NetTopologyDeviceMapMutation) SetPositionY(i int)

SetPositionY sets the "position_y" field.

func (NetTopologyDeviceMapMutation) Tx

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*NetTopologyDeviceMapMutation) Type

Type returns the node type of this mutation (NetTopologyDeviceMap).

type NetTopologyDeviceMapQuery

type NetTopologyDeviceMapQuery struct {
	// contains filtered or unexported fields
}

NetTopologyDeviceMapQuery is the builder for querying NetTopologyDeviceMap entities.

func (*NetTopologyDeviceMapQuery) All

All executes the query and returns a list of NetTopologyDeviceMaps.

func (*NetTopologyDeviceMapQuery) AllX

AllX is like All, but panics if an error occurs.

func (*NetTopologyDeviceMapQuery) Clone

Clone returns a duplicate of the NetTopologyDeviceMapQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*NetTopologyDeviceMapQuery) Count

func (ntdmq *NetTopologyDeviceMapQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*NetTopologyDeviceMapQuery) CountX

func (ntdmq *NetTopologyDeviceMapQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*NetTopologyDeviceMapQuery) Exist

func (ntdmq *NetTopologyDeviceMapQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*NetTopologyDeviceMapQuery) ExistX

func (ntdmq *NetTopologyDeviceMapQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*NetTopologyDeviceMapQuery) First

First returns the first NetTopologyDeviceMap entity from the query. Returns a *NotFoundError when no NetTopologyDeviceMap was found.

func (*NetTopologyDeviceMapQuery) FirstID

func (ntdmq *NetTopologyDeviceMapQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first NetTopologyDeviceMap ID from the query. Returns a *NotFoundError when no NetTopologyDeviceMap ID was found.

func (*NetTopologyDeviceMapQuery) FirstIDX

func (ntdmq *NetTopologyDeviceMapQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*NetTopologyDeviceMapQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*NetTopologyDeviceMapQuery) GroupBy

func (ntdmq *NetTopologyDeviceMapQuery) GroupBy(field string, fields ...string) *NetTopologyDeviceMapGroupBy

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 {
	PositionX int `json:"position_x,omitempty"`
	Count int `json:"count,omitempty"`
}

client.NetTopologyDeviceMap.Query().
	GroupBy(nettopologydevicemap.FieldPositionX).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*NetTopologyDeviceMapQuery) IDs

func (ntdmq *NetTopologyDeviceMapQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of NetTopologyDeviceMap IDs.

func (*NetTopologyDeviceMapQuery) IDsX

func (ntdmq *NetTopologyDeviceMapQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*NetTopologyDeviceMapQuery) Limit

Limit adds a limit step to the query.

func (*NetTopologyDeviceMapQuery) Offset

Offset adds an offset step to the query.

func (*NetTopologyDeviceMapQuery) Only

Only returns a single NetTopologyDeviceMap entity found by the query, ensuring it only returns one. Returns a *NotSingularError when exactly one NetTopologyDeviceMap entity is not found. Returns a *NotFoundError when no NetTopologyDeviceMap entities are found.

func (*NetTopologyDeviceMapQuery) OnlyID

func (ntdmq *NetTopologyDeviceMapQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only NetTopologyDeviceMap ID in the query. Returns a *NotSingularError when exactly one NetTopologyDeviceMap ID is not found. Returns a *NotFoundError when no entities are found.

func (*NetTopologyDeviceMapQuery) OnlyIDX

func (ntdmq *NetTopologyDeviceMapQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*NetTopologyDeviceMapQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*NetTopologyDeviceMapQuery) Order

Order adds an order step to the query.

func (*NetTopologyDeviceMapQuery) QueryDevice

func (ntdmq *NetTopologyDeviceMapQuery) QueryDevice() *DeviceQuery

QueryDevice chains the current query on the "device" edge.

func (*NetTopologyDeviceMapQuery) QueryEdge

QueryEdge chains the current query on the "edge" edge.

func (*NetTopologyDeviceMapQuery) QueryOnTopology

func (ntdmq *NetTopologyDeviceMapQuery) QueryOnTopology() *NetTopologyQuery

QueryOnTopology chains the current query on the "on_topology" edge.

func (*NetTopologyDeviceMapQuery) Select

func (ntdmq *NetTopologyDeviceMapQuery) Select(field string, fields ...string) *NetTopologyDeviceMapSelect

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 {
	PositionX int `json:"position_x,omitempty"`
}

client.NetTopologyDeviceMap.Query().
	Select(nettopologydevicemap.FieldPositionX).
	Scan(ctx, &v)

func (*NetTopologyDeviceMapQuery) Unique

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 (*NetTopologyDeviceMapQuery) Where

Where adds a new predicate for the NetTopologyDeviceMapQuery builder.

func (*NetTopologyDeviceMapQuery) WithDevice

func (ntdmq *NetTopologyDeviceMapQuery) WithDevice(opts ...func(*DeviceQuery)) *NetTopologyDeviceMapQuery

WithDevice tells the query-builder to eager-load the nodes that are connected to the "device" edge. The optional arguments are used to configure the query builder of the edge.

func (*NetTopologyDeviceMapQuery) WithEdge

WithEdge tells the query-builder to eager-load the nodes that are connected to the "edge" edge. The optional arguments are used to configure the query builder of the edge.

func (*NetTopologyDeviceMapQuery) WithOnTopology

func (ntdmq *NetTopologyDeviceMapQuery) WithOnTopology(opts ...func(*NetTopologyQuery)) *NetTopologyDeviceMapQuery

WithOnTopology tells the query-builder to eager-load the nodes that are connected to the "on_topology" edge. The optional arguments are used to configure the query builder of the edge.

type NetTopologyDeviceMapSelect

type NetTopologyDeviceMapSelect struct {
	*NetTopologyDeviceMapQuery
	// contains filtered or unexported fields
}

NetTopologyDeviceMapSelect is the builder for selecting fields of NetTopologyDeviceMap entities.

func (*NetTopologyDeviceMapSelect) Bool

func (ntdms *NetTopologyDeviceMapSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*NetTopologyDeviceMapSelect) BoolX

func (ntdms *NetTopologyDeviceMapSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*NetTopologyDeviceMapSelect) Bools

func (ntdms *NetTopologyDeviceMapSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*NetTopologyDeviceMapSelect) BoolsX

func (ntdms *NetTopologyDeviceMapSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*NetTopologyDeviceMapSelect) Float64

func (ntdms *NetTopologyDeviceMapSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*NetTopologyDeviceMapSelect) Float64X

func (ntdms *NetTopologyDeviceMapSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*NetTopologyDeviceMapSelect) Float64s

func (ntdms *NetTopologyDeviceMapSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*NetTopologyDeviceMapSelect) Float64sX

func (ntdms *NetTopologyDeviceMapSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*NetTopologyDeviceMapSelect) Int

func (ntdms *NetTopologyDeviceMapSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*NetTopologyDeviceMapSelect) IntX

func (ntdms *NetTopologyDeviceMapSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*NetTopologyDeviceMapSelect) Ints

func (ntdms *NetTopologyDeviceMapSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*NetTopologyDeviceMapSelect) IntsX

func (ntdms *NetTopologyDeviceMapSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*NetTopologyDeviceMapSelect) Scan

func (ntdms *NetTopologyDeviceMapSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*NetTopologyDeviceMapSelect) ScanX

func (ntdms *NetTopologyDeviceMapSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*NetTopologyDeviceMapSelect) String

func (ntdms *NetTopologyDeviceMapSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*NetTopologyDeviceMapSelect) StringX

func (ntdms *NetTopologyDeviceMapSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*NetTopologyDeviceMapSelect) Strings

func (ntdms *NetTopologyDeviceMapSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*NetTopologyDeviceMapSelect) StringsX

func (ntdms *NetTopologyDeviceMapSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type NetTopologyDeviceMapUpdate

type NetTopologyDeviceMapUpdate struct {
	// contains filtered or unexported fields
}

NetTopologyDeviceMapUpdate is the builder for updating NetTopologyDeviceMap entities.

func (*NetTopologyDeviceMapUpdate) AddEdge

AddEdge adds the "edge" edges to the NetTopologyDeviceMap entity.

func (*NetTopologyDeviceMapUpdate) AddEdgeIDs

func (ntdmu *NetTopologyDeviceMapUpdate) AddEdgeIDs(ids ...int) *NetTopologyDeviceMapUpdate

AddEdgeIDs adds the "edge" edge to the NetTopologyDeviceMap entity by IDs.

func (*NetTopologyDeviceMapUpdate) AddPositionX

AddPositionX adds i to the "position_x" field.

func (*NetTopologyDeviceMapUpdate) AddPositionY

AddPositionY adds i to the "position_y" field.

func (*NetTopologyDeviceMapUpdate) ClearDevice

ClearDevice clears the "device" edge to the Device entity.

func (*NetTopologyDeviceMapUpdate) ClearEdgeEdge

ClearEdgeEdge clears all "edge" edges to the NetTopologyDeviceMap entity.

func (*NetTopologyDeviceMapUpdate) ClearOnTopology

func (ntdmu *NetTopologyDeviceMapUpdate) ClearOnTopology() *NetTopologyDeviceMapUpdate

ClearOnTopology clears the "on_topology" edge to the NetTopology entity.

func (*NetTopologyDeviceMapUpdate) Exec

Exec executes the query.

func (*NetTopologyDeviceMapUpdate) ExecX

func (ntdmu *NetTopologyDeviceMapUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NetTopologyDeviceMapUpdate) Mutation

Mutation returns the NetTopologyDeviceMapMutation object of the builder.

func (*NetTopologyDeviceMapUpdate) RemoveEdge

RemoveEdge removes "edge" edges to NetTopologyDeviceMap entities.

func (*NetTopologyDeviceMapUpdate) RemoveEdgeIDs

func (ntdmu *NetTopologyDeviceMapUpdate) RemoveEdgeIDs(ids ...int) *NetTopologyDeviceMapUpdate

RemoveEdgeIDs removes the "edge" edge to NetTopologyDeviceMap entities by IDs.

func (*NetTopologyDeviceMapUpdate) Save

func (ntdmu *NetTopologyDeviceMapUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*NetTopologyDeviceMapUpdate) SaveX

func (ntdmu *NetTopologyDeviceMapUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*NetTopologyDeviceMapUpdate) SetDevice

SetDevice sets the "device" edge to the Device entity.

func (*NetTopologyDeviceMapUpdate) SetDeviceID

SetDeviceID sets the "device" edge to the Device entity by ID.

func (*NetTopologyDeviceMapUpdate) SetNillableDeviceID

func (ntdmu *NetTopologyDeviceMapUpdate) SetNillableDeviceID(id *int) *NetTopologyDeviceMapUpdate

SetNillableDeviceID sets the "device" edge to the Device entity by ID if the given value is not nil.

func (*NetTopologyDeviceMapUpdate) SetNillableOnTopologyID

func (ntdmu *NetTopologyDeviceMapUpdate) SetNillableOnTopologyID(id *int) *NetTopologyDeviceMapUpdate

SetNillableOnTopologyID sets the "on_topology" edge to the NetTopology entity by ID if the given value is not nil.

func (*NetTopologyDeviceMapUpdate) SetNillablePositionX

func (ntdmu *NetTopologyDeviceMapUpdate) SetNillablePositionX(i *int) *NetTopologyDeviceMapUpdate

SetNillablePositionX sets the "position_x" field if the given value is not nil.

func (*NetTopologyDeviceMapUpdate) SetNillablePositionY

func (ntdmu *NetTopologyDeviceMapUpdate) SetNillablePositionY(i *int) *NetTopologyDeviceMapUpdate

SetNillablePositionY sets the "position_y" field if the given value is not nil.

func (*NetTopologyDeviceMapUpdate) SetOnTopology

SetOnTopology sets the "on_topology" edge to the NetTopology entity.

func (*NetTopologyDeviceMapUpdate) SetOnTopologyID

func (ntdmu *NetTopologyDeviceMapUpdate) SetOnTopologyID(id int) *NetTopologyDeviceMapUpdate

SetOnTopologyID sets the "on_topology" edge to the NetTopology entity by ID.

func (*NetTopologyDeviceMapUpdate) SetPositionX

SetPositionX sets the "position_x" field.

func (*NetTopologyDeviceMapUpdate) SetPositionY

SetPositionY sets the "position_y" field.

func (*NetTopologyDeviceMapUpdate) Where

Where adds a new predicate for the NetTopologyDeviceMapUpdate builder.

type NetTopologyDeviceMapUpdateOne

type NetTopologyDeviceMapUpdateOne struct {
	// contains filtered or unexported fields
}

NetTopologyDeviceMapUpdateOne is the builder for updating a single NetTopologyDeviceMap entity.

func (*NetTopologyDeviceMapUpdateOne) AddEdge

AddEdge adds the "edge" edges to the NetTopologyDeviceMap entity.

func (*NetTopologyDeviceMapUpdateOne) AddEdgeIDs

AddEdgeIDs adds the "edge" edge to the NetTopologyDeviceMap entity by IDs.

func (*NetTopologyDeviceMapUpdateOne) AddPositionX

AddPositionX adds i to the "position_x" field.

func (*NetTopologyDeviceMapUpdateOne) AddPositionY

AddPositionY adds i to the "position_y" field.

func (*NetTopologyDeviceMapUpdateOne) ClearDevice

ClearDevice clears the "device" edge to the Device entity.

func (*NetTopologyDeviceMapUpdateOne) ClearEdgeEdge

ClearEdgeEdge clears all "edge" edges to the NetTopologyDeviceMap entity.

func (*NetTopologyDeviceMapUpdateOne) ClearOnTopology

ClearOnTopology clears the "on_topology" edge to the NetTopology entity.

func (*NetTopologyDeviceMapUpdateOne) Exec

Exec executes the query on the entity.

func (*NetTopologyDeviceMapUpdateOne) ExecX

func (ntdmuo *NetTopologyDeviceMapUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NetTopologyDeviceMapUpdateOne) Mutation

Mutation returns the NetTopologyDeviceMapMutation object of the builder.

func (*NetTopologyDeviceMapUpdateOne) RemoveEdge

RemoveEdge removes "edge" edges to NetTopologyDeviceMap entities.

func (*NetTopologyDeviceMapUpdateOne) RemoveEdgeIDs

func (ntdmuo *NetTopologyDeviceMapUpdateOne) RemoveEdgeIDs(ids ...int) *NetTopologyDeviceMapUpdateOne

RemoveEdgeIDs removes the "edge" edge to NetTopologyDeviceMap entities by IDs.

func (*NetTopologyDeviceMapUpdateOne) Save

Save executes the query and returns the updated NetTopologyDeviceMap entity.

func (*NetTopologyDeviceMapUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*NetTopologyDeviceMapUpdateOne) Select

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*NetTopologyDeviceMapUpdateOne) SetDevice

SetDevice sets the "device" edge to the Device entity.

func (*NetTopologyDeviceMapUpdateOne) SetDeviceID

SetDeviceID sets the "device" edge to the Device entity by ID.

func (*NetTopologyDeviceMapUpdateOne) SetNillableDeviceID

func (ntdmuo *NetTopologyDeviceMapUpdateOne) SetNillableDeviceID(id *int) *NetTopologyDeviceMapUpdateOne

SetNillableDeviceID sets the "device" edge to the Device entity by ID if the given value is not nil.

func (*NetTopologyDeviceMapUpdateOne) SetNillableOnTopologyID

func (ntdmuo *NetTopologyDeviceMapUpdateOne) SetNillableOnTopologyID(id *int) *NetTopologyDeviceMapUpdateOne

SetNillableOnTopologyID sets the "on_topology" edge to the NetTopology entity by ID if the given value is not nil.

func (*NetTopologyDeviceMapUpdateOne) SetNillablePositionX

func (ntdmuo *NetTopologyDeviceMapUpdateOne) SetNillablePositionX(i *int) *NetTopologyDeviceMapUpdateOne

SetNillablePositionX sets the "position_x" field if the given value is not nil.

func (*NetTopologyDeviceMapUpdateOne) SetNillablePositionY

func (ntdmuo *NetTopologyDeviceMapUpdateOne) SetNillablePositionY(i *int) *NetTopologyDeviceMapUpdateOne

SetNillablePositionY sets the "position_y" field if the given value is not nil.

func (*NetTopologyDeviceMapUpdateOne) SetOnTopology

SetOnTopology sets the "on_topology" edge to the NetTopology entity.

func (*NetTopologyDeviceMapUpdateOne) SetOnTopologyID

SetOnTopologyID sets the "on_topology" edge to the NetTopology entity by ID.

func (*NetTopologyDeviceMapUpdateOne) SetPositionX

SetPositionX sets the "position_x" field.

func (*NetTopologyDeviceMapUpdateOne) SetPositionY

SetPositionY sets the "position_y" field.

type NetTopologyDeviceMaps

type NetTopologyDeviceMaps []*NetTopologyDeviceMap

NetTopologyDeviceMaps is a parsable slice of NetTopologyDeviceMap.

type NetTopologyEdges

type NetTopologyEdges struct {
	// Topology holds the value of the topology edge.
	Topology []*NetTopologyDeviceMap `json:"topology,omitempty"`
	// contains filtered or unexported fields
}

NetTopologyEdges holds the relations/edges for other nodes in the graph.

func (NetTopologyEdges) TopologyOrErr

func (e NetTopologyEdges) TopologyOrErr() ([]*NetTopologyDeviceMap, error)

TopologyOrErr returns the Topology value or an error if the edge was not loaded in eager-loading.

type NetTopologyGroupBy

type NetTopologyGroupBy struct {
	// contains filtered or unexported fields
}

NetTopologyGroupBy is the group-by builder for NetTopology entities.

func (*NetTopologyGroupBy) Aggregate

func (ntgb *NetTopologyGroupBy) Aggregate(fns ...AggregateFunc) *NetTopologyGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*NetTopologyGroupBy) Bool

func (ntgb *NetTopologyGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*NetTopologyGroupBy) BoolX

func (ntgb *NetTopologyGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*NetTopologyGroupBy) Bools

func (ntgb *NetTopologyGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*NetTopologyGroupBy) BoolsX

func (ntgb *NetTopologyGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*NetTopologyGroupBy) Float64

func (ntgb *NetTopologyGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*NetTopologyGroupBy) Float64X

func (ntgb *NetTopologyGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*NetTopologyGroupBy) Float64s

func (ntgb *NetTopologyGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*NetTopologyGroupBy) Float64sX

func (ntgb *NetTopologyGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*NetTopologyGroupBy) Int

func (ntgb *NetTopologyGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*NetTopologyGroupBy) IntX

func (ntgb *NetTopologyGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*NetTopologyGroupBy) Ints

func (ntgb *NetTopologyGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*NetTopologyGroupBy) IntsX

func (ntgb *NetTopologyGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*NetTopologyGroupBy) Scan

func (ntgb *NetTopologyGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*NetTopologyGroupBy) ScanX

func (ntgb *NetTopologyGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*NetTopologyGroupBy) String

func (ntgb *NetTopologyGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*NetTopologyGroupBy) StringX

func (ntgb *NetTopologyGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*NetTopologyGroupBy) Strings

func (ntgb *NetTopologyGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*NetTopologyGroupBy) StringsX

func (ntgb *NetTopologyGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type NetTopologyMutation

type NetTopologyMutation struct {
	// contains filtered or unexported fields
}

NetTopologyMutation represents an operation that mutates the NetTopology nodes in the graph.

func (*NetTopologyMutation) AddField

func (m *NetTopologyMutation) 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 (*NetTopologyMutation) AddTopologyIDs

func (m *NetTopologyMutation) AddTopologyIDs(ids ...int)

AddTopologyIDs adds the "topology" edge to the NetTopologyDeviceMap entity by ids.

func (*NetTopologyMutation) AddedEdges

func (m *NetTopologyMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*NetTopologyMutation) AddedField

func (m *NetTopologyMutation) 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 (*NetTopologyMutation) AddedFields

func (m *NetTopologyMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*NetTopologyMutation) AddedIDs

func (m *NetTopologyMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*NetTopologyMutation) ClearEdge

func (m *NetTopologyMutation) 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 (*NetTopologyMutation) ClearField

func (m *NetTopologyMutation) 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 (*NetTopologyMutation) ClearTopology

func (m *NetTopologyMutation) ClearTopology()

ClearTopology clears the "topology" edge to the NetTopologyDeviceMap entity.

func (*NetTopologyMutation) ClearedEdges

func (m *NetTopologyMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*NetTopologyMutation) ClearedFields

func (m *NetTopologyMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (NetTopologyMutation) Client

func (m NetTopologyMutation) 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 (*NetTopologyMutation) EdgeCleared

func (m *NetTopologyMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*NetTopologyMutation) Field

func (m *NetTopologyMutation) 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 (*NetTopologyMutation) FieldCleared

func (m *NetTopologyMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*NetTopologyMutation) Fields

func (m *NetTopologyMutation) 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 (*NetTopologyMutation) ID

func (m *NetTopologyMutation) 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.

func (*NetTopologyMutation) OldField

func (m *NetTopologyMutation) 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 (*NetTopologyMutation) OldTopologyDescription

func (m *NetTopologyMutation) OldTopologyDescription(ctx context.Context) (v string, err error)

OldTopologyDescription returns the old "topology_description" field's value of the NetTopology entity. If the NetTopology 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 (*NetTopologyMutation) OldTopologyName

func (m *NetTopologyMutation) OldTopologyName(ctx context.Context) (v string, err error)

OldTopologyName returns the old "topology_name" field's value of the NetTopology entity. If the NetTopology 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 (*NetTopologyMutation) Op

func (m *NetTopologyMutation) Op() Op

Op returns the operation name.

func (*NetTopologyMutation) RemoveTopologyIDs

func (m *NetTopologyMutation) RemoveTopologyIDs(ids ...int)

RemoveTopologyIDs removes the "topology" edge to the NetTopologyDeviceMap entity by IDs.

func (*NetTopologyMutation) RemovedEdges

func (m *NetTopologyMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*NetTopologyMutation) RemovedIDs

func (m *NetTopologyMutation) 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 (*NetTopologyMutation) RemovedTopologyIDs

func (m *NetTopologyMutation) RemovedTopologyIDs() (ids []int)

RemovedTopology returns the removed IDs of the "topology" edge to the NetTopologyDeviceMap entity.

func (*NetTopologyMutation) ResetEdge

func (m *NetTopologyMutation) 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 (*NetTopologyMutation) ResetField

func (m *NetTopologyMutation) 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 (*NetTopologyMutation) ResetTopology

func (m *NetTopologyMutation) ResetTopology()

ResetTopology resets all changes to the "topology" edge.

func (*NetTopologyMutation) ResetTopologyDescription

func (m *NetTopologyMutation) ResetTopologyDescription()

ResetTopologyDescription resets all changes to the "topology_description" field.

func (*NetTopologyMutation) ResetTopologyName

func (m *NetTopologyMutation) ResetTopologyName()

ResetTopologyName resets all changes to the "topology_name" field.

func (*NetTopologyMutation) SetField

func (m *NetTopologyMutation) 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 (*NetTopologyMutation) SetTopologyDescription

func (m *NetTopologyMutation) SetTopologyDescription(s string)

SetTopologyDescription sets the "topology_description" field.

func (*NetTopologyMutation) SetTopologyName

func (m *NetTopologyMutation) SetTopologyName(s string)

SetTopologyName sets the "topology_name" field.

func (*NetTopologyMutation) TopologyCleared

func (m *NetTopologyMutation) TopologyCleared() bool

TopologyCleared reports if the "topology" edge to the NetTopologyDeviceMap entity was cleared.

func (*NetTopologyMutation) TopologyDescription

func (m *NetTopologyMutation) TopologyDescription() (r string, exists bool)

TopologyDescription returns the value of the "topology_description" field in the mutation.

func (*NetTopologyMutation) TopologyIDs

func (m *NetTopologyMutation) TopologyIDs() (ids []int)

TopologyIDs returns the "topology" edge IDs in the mutation.

func (*NetTopologyMutation) TopologyName

func (m *NetTopologyMutation) TopologyName() (r string, exists bool)

TopologyName returns the value of the "topology_name" field in the mutation.

func (NetTopologyMutation) Tx

func (m NetTopologyMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*NetTopologyMutation) Type

func (m *NetTopologyMutation) Type() string

Type returns the node type of this mutation (NetTopology).

type NetTopologyQuery

type NetTopologyQuery struct {
	// contains filtered or unexported fields
}

NetTopologyQuery is the builder for querying NetTopology entities.

func (*NetTopologyQuery) All

func (ntq *NetTopologyQuery) All(ctx context.Context) ([]*NetTopology, error)

All executes the query and returns a list of NetTopologies.

func (*NetTopologyQuery) AllX

func (ntq *NetTopologyQuery) AllX(ctx context.Context) []*NetTopology

AllX is like All, but panics if an error occurs.

func (*NetTopologyQuery) Clone

func (ntq *NetTopologyQuery) Clone() *NetTopologyQuery

Clone returns a duplicate of the NetTopologyQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*NetTopologyQuery) Count

func (ntq *NetTopologyQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*NetTopologyQuery) CountX

func (ntq *NetTopologyQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*NetTopologyQuery) Exist

func (ntq *NetTopologyQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*NetTopologyQuery) ExistX

func (ntq *NetTopologyQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*NetTopologyQuery) First

func (ntq *NetTopologyQuery) First(ctx context.Context) (*NetTopology, error)

First returns the first NetTopology entity from the query. Returns a *NotFoundError when no NetTopology was found.

func (*NetTopologyQuery) FirstID

func (ntq *NetTopologyQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first NetTopology ID from the query. Returns a *NotFoundError when no NetTopology ID was found.

func (*NetTopologyQuery) FirstIDX

func (ntq *NetTopologyQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*NetTopologyQuery) FirstX

func (ntq *NetTopologyQuery) FirstX(ctx context.Context) *NetTopology

FirstX is like First, but panics if an error occurs.

func (*NetTopologyQuery) GroupBy

func (ntq *NetTopologyQuery) GroupBy(field string, fields ...string) *NetTopologyGroupBy

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 {
	TopologyName string `json:"topology_name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.NetTopology.Query().
	GroupBy(nettopology.FieldTopologyName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*NetTopologyQuery) IDs

func (ntq *NetTopologyQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of NetTopology IDs.

func (*NetTopologyQuery) IDsX

func (ntq *NetTopologyQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*NetTopologyQuery) Limit

func (ntq *NetTopologyQuery) Limit(limit int) *NetTopologyQuery

Limit adds a limit step to the query.

func (*NetTopologyQuery) Offset

func (ntq *NetTopologyQuery) Offset(offset int) *NetTopologyQuery

Offset adds an offset step to the query.

func (*NetTopologyQuery) Only

func (ntq *NetTopologyQuery) Only(ctx context.Context) (*NetTopology, error)

Only returns a single NetTopology entity found by the query, ensuring it only returns one. Returns a *NotSingularError when exactly one NetTopology entity is not found. Returns a *NotFoundError when no NetTopology entities are found.

func (*NetTopologyQuery) OnlyID

func (ntq *NetTopologyQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only NetTopology ID in the query. Returns a *NotSingularError when exactly one NetTopology ID is not found. Returns a *NotFoundError when no entities are found.

func (*NetTopologyQuery) OnlyIDX

func (ntq *NetTopologyQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*NetTopologyQuery) OnlyX

func (ntq *NetTopologyQuery) OnlyX(ctx context.Context) *NetTopology

OnlyX is like Only, but panics if an error occurs.

func (*NetTopologyQuery) Order

func (ntq *NetTopologyQuery) Order(o ...OrderFunc) *NetTopologyQuery

Order adds an order step to the query.

func (*NetTopologyQuery) QueryTopology

func (ntq *NetTopologyQuery) QueryTopology() *NetTopologyDeviceMapQuery

QueryTopology chains the current query on the "topology" edge.

func (*NetTopologyQuery) Select

func (ntq *NetTopologyQuery) Select(field string, fields ...string) *NetTopologySelect

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 {
	TopologyName string `json:"topology_name,omitempty"`
}

client.NetTopology.Query().
	Select(nettopology.FieldTopologyName).
	Scan(ctx, &v)

func (*NetTopologyQuery) Unique

func (ntq *NetTopologyQuery) Unique(unique bool) *NetTopologyQuery

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 (*NetTopologyQuery) Where

Where adds a new predicate for the NetTopologyQuery builder.

func (*NetTopologyQuery) WithTopology

func (ntq *NetTopologyQuery) WithTopology(opts ...func(*NetTopologyDeviceMapQuery)) *NetTopologyQuery

WithTopology tells the query-builder to eager-load the nodes that are connected to the "topology" edge. The optional arguments are used to configure the query builder of the edge.

type NetTopologySelect

type NetTopologySelect struct {
	*NetTopologyQuery
	// contains filtered or unexported fields
}

NetTopologySelect is the builder for selecting fields of NetTopology entities.

func (*NetTopologySelect) Bool

func (nts *NetTopologySelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*NetTopologySelect) BoolX

func (nts *NetTopologySelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*NetTopologySelect) Bools

func (nts *NetTopologySelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*NetTopologySelect) BoolsX

func (nts *NetTopologySelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*NetTopologySelect) Float64

func (nts *NetTopologySelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*NetTopologySelect) Float64X

func (nts *NetTopologySelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*NetTopologySelect) Float64s

func (nts *NetTopologySelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*NetTopologySelect) Float64sX

func (nts *NetTopologySelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*NetTopologySelect) Int

func (nts *NetTopologySelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*NetTopologySelect) IntX

func (nts *NetTopologySelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*NetTopologySelect) Ints

func (nts *NetTopologySelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*NetTopologySelect) IntsX

func (nts *NetTopologySelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*NetTopologySelect) Scan

func (nts *NetTopologySelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*NetTopologySelect) ScanX

func (nts *NetTopologySelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*NetTopologySelect) String

func (nts *NetTopologySelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*NetTopologySelect) StringX

func (nts *NetTopologySelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*NetTopologySelect) Strings

func (nts *NetTopologySelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*NetTopologySelect) StringsX

func (nts *NetTopologySelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type NetTopologyUpdate

type NetTopologyUpdate struct {
	// contains filtered or unexported fields
}

NetTopologyUpdate is the builder for updating NetTopology entities.

func (*NetTopologyUpdate) AddTopology

func (ntu *NetTopologyUpdate) AddTopology(n ...*NetTopologyDeviceMap) *NetTopologyUpdate

AddTopology adds the "topology" edges to the NetTopologyDeviceMap entity.

func (*NetTopologyUpdate) AddTopologyIDs

func (ntu *NetTopologyUpdate) AddTopologyIDs(ids ...int) *NetTopologyUpdate

AddTopologyIDs adds the "topology" edge to the NetTopologyDeviceMap entity by IDs.

func (*NetTopologyUpdate) ClearTopology

func (ntu *NetTopologyUpdate) ClearTopology() *NetTopologyUpdate

ClearTopology clears all "topology" edges to the NetTopologyDeviceMap entity.

func (*NetTopologyUpdate) Exec

func (ntu *NetTopologyUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*NetTopologyUpdate) ExecX

func (ntu *NetTopologyUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NetTopologyUpdate) Mutation

func (ntu *NetTopologyUpdate) Mutation() *NetTopologyMutation

Mutation returns the NetTopologyMutation object of the builder.

func (*NetTopologyUpdate) RemoveTopology

func (ntu *NetTopologyUpdate) RemoveTopology(n ...*NetTopologyDeviceMap) *NetTopologyUpdate

RemoveTopology removes "topology" edges to NetTopologyDeviceMap entities.

func (*NetTopologyUpdate) RemoveTopologyIDs

func (ntu *NetTopologyUpdate) RemoveTopologyIDs(ids ...int) *NetTopologyUpdate

RemoveTopologyIDs removes the "topology" edge to NetTopologyDeviceMap entities by IDs.

func (*NetTopologyUpdate) Save

func (ntu *NetTopologyUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*NetTopologyUpdate) SaveX

func (ntu *NetTopologyUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*NetTopologyUpdate) SetTopologyDescription

func (ntu *NetTopologyUpdate) SetTopologyDescription(s string) *NetTopologyUpdate

SetTopologyDescription sets the "topology_description" field.

func (*NetTopologyUpdate) SetTopologyName

func (ntu *NetTopologyUpdate) SetTopologyName(s string) *NetTopologyUpdate

SetTopologyName sets the "topology_name" field.

func (*NetTopologyUpdate) Where

Where adds a new predicate for the NetTopologyUpdate builder.

type NetTopologyUpdateOne

type NetTopologyUpdateOne struct {
	// contains filtered or unexported fields
}

NetTopologyUpdateOne is the builder for updating a single NetTopology entity.

func (*NetTopologyUpdateOne) AddTopology

AddTopology adds the "topology" edges to the NetTopologyDeviceMap entity.

func (*NetTopologyUpdateOne) AddTopologyIDs

func (ntuo *NetTopologyUpdateOne) AddTopologyIDs(ids ...int) *NetTopologyUpdateOne

AddTopologyIDs adds the "topology" edge to the NetTopologyDeviceMap entity by IDs.

func (*NetTopologyUpdateOne) ClearTopology

func (ntuo *NetTopologyUpdateOne) ClearTopology() *NetTopologyUpdateOne

ClearTopology clears all "topology" edges to the NetTopologyDeviceMap entity.

func (*NetTopologyUpdateOne) Exec

func (ntuo *NetTopologyUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*NetTopologyUpdateOne) ExecX

func (ntuo *NetTopologyUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NetTopologyUpdateOne) Mutation

func (ntuo *NetTopologyUpdateOne) Mutation() *NetTopologyMutation

Mutation returns the NetTopologyMutation object of the builder.

func (*NetTopologyUpdateOne) RemoveTopology

func (ntuo *NetTopologyUpdateOne) RemoveTopology(n ...*NetTopologyDeviceMap) *NetTopologyUpdateOne

RemoveTopology removes "topology" edges to NetTopologyDeviceMap entities.

func (*NetTopologyUpdateOne) RemoveTopologyIDs

func (ntuo *NetTopologyUpdateOne) RemoveTopologyIDs(ids ...int) *NetTopologyUpdateOne

RemoveTopologyIDs removes the "topology" edge to NetTopologyDeviceMap entities by IDs.

func (*NetTopologyUpdateOne) Save

Save executes the query and returns the updated NetTopology entity.

func (*NetTopologyUpdateOne) SaveX

func (ntuo *NetTopologyUpdateOne) SaveX(ctx context.Context) *NetTopology

SaveX is like Save, but panics if an error occurs.

func (*NetTopologyUpdateOne) Select

func (ntuo *NetTopologyUpdateOne) Select(field string, fields ...string) *NetTopologyUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*NetTopologyUpdateOne) SetTopologyDescription

func (ntuo *NetTopologyUpdateOne) SetTopologyDescription(s string) *NetTopologyUpdateOne

SetTopologyDescription sets the "topology_description" field.

func (*NetTopologyUpdateOne) SetTopologyName

func (ntuo *NetTopologyUpdateOne) SetTopologyName(s string) *NetTopologyUpdateOne

SetTopologyName sets the "topology_name" field.

type NotFoundError

type NotFoundError struct {
	// contains filtered or unexported fields
}

NotFoundError returns when trying to fetch a specific entity and it was not found in the database.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

type NotLoadedError struct {
	// contains filtered or unexported fields
}

NotLoadedError returns when trying to get a node that was not loaded by the query.

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

type NotSingularError struct {
	// contains filtered or unexported fields
}

NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

ent aliases to avoid import conflicts in user's code.

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...interface{})) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector.

func Asc

func Asc(fields ...string) OrderFunc

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) OrderFunc

Desc applies the given fields in DESC order.

type Policy

type Policy = ent.Policy

ent aliases to avoid import conflicts in user's code.

type PortChannelInterface added in v0.2.0

type PortChannelInterface struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// PoInterfaceID holds the value of the "po_interface_id" field.
	PoInterfaceID int `json:"po_interface_id,omitempty"`
	// PoInterfaceShutdown holds the value of the "po_interface_shutdown" field.
	PoInterfaceShutdown bool `json:"po_interface_shutdown,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the PortChannelInterfaceQuery when eager-loading is set.
	Edges PortChannelInterfaceEdges `json:"edges"`
	// contains filtered or unexported fields
}

PortChannelInterface is the model entity for the PortChannelInterface schema.

func (*PortChannelInterface) QueryHaveVlans added in v0.2.0

func (pci *PortChannelInterface) QueryHaveVlans() *VlanQuery

QueryHaveVlans queries the "have_vlans" edge of the PortChannelInterface entity.

func (*PortChannelInterface) QueryInterfaces added in v0.2.0

func (pci *PortChannelInterface) QueryInterfaces() *NetInterfaceQuery

QueryInterfaces queries the "interfaces" edge of the PortChannelInterface entity.

func (*PortChannelInterface) QueryMode added in v0.2.0

func (pci *PortChannelInterface) QueryMode() *NetInterfaceModeQuery

QueryMode queries the "mode" edge of the PortChannelInterface entity.

func (*PortChannelInterface) QueryNativeOnVlan added in v0.2.0

func (pci *PortChannelInterface) QueryNativeOnVlan() *VlanQuery

QueryNativeOnVlan queries the "native_on_vlan" edge of the PortChannelInterface entity.

func (*PortChannelInterface) QueryOnDevice added in v0.2.0

func (pci *PortChannelInterface) QueryOnDevice() *DeviceQuery

QueryOnDevice queries the "on_device" edge of the PortChannelInterface entity.

func (*PortChannelInterface) QueryOnIPAddress added in v0.2.0

func (pci *PortChannelInterface) QueryOnIPAddress() *IPAddressQuery

QueryOnIPAddress queries the "on_ip_address" edge of the PortChannelInterface entity.

func (*PortChannelInterface) QueryOnLayer added in v0.2.0

func (pci *PortChannelInterface) QueryOnLayer() *NetInterfaceLayerQuery

QueryOnLayer queries the "on_layer" edge of the PortChannelInterface entity.

func (*PortChannelInterface) String added in v0.2.0

func (pci *PortChannelInterface) String() string

String implements the fmt.Stringer.

func (*PortChannelInterface) Unwrap added in v0.2.0

Unwrap unwraps the PortChannelInterface 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 (*PortChannelInterface) Update added in v0.2.0

Update returns a builder for updating this PortChannelInterface. Note that you need to call PortChannelInterface.Unwrap() before calling this method if this PortChannelInterface was returned from a transaction, and the transaction was committed or rolled back.

type PortChannelInterfaceClient added in v0.2.0

type PortChannelInterfaceClient struct {
	// contains filtered or unexported fields
}

PortChannelInterfaceClient is a client for the PortChannelInterface schema.

func NewPortChannelInterfaceClient added in v0.2.0

func NewPortChannelInterfaceClient(c config) *PortChannelInterfaceClient

NewPortChannelInterfaceClient returns a client for the PortChannelInterface from the given config.

func (*PortChannelInterfaceClient) Create added in v0.2.0

Create returns a create builder for PortChannelInterface.

func (*PortChannelInterfaceClient) CreateBulk added in v0.2.0

CreateBulk returns a builder for creating a bulk of PortChannelInterface entities.

func (*PortChannelInterfaceClient) Delete added in v0.2.0

Delete returns a delete builder for PortChannelInterface.

func (*PortChannelInterfaceClient) DeleteOne added in v0.2.0

DeleteOne returns a delete builder for the given entity.

func (*PortChannelInterfaceClient) DeleteOneID added in v0.2.0

DeleteOneID returns a delete builder for the given id.

func (*PortChannelInterfaceClient) Get added in v0.2.0

Get returns a PortChannelInterface entity by its id.

func (*PortChannelInterfaceClient) GetX added in v0.2.0

GetX is like Get, but panics if an error occurs.

func (*PortChannelInterfaceClient) Hooks added in v0.2.0

func (c *PortChannelInterfaceClient) Hooks() []Hook

Hooks returns the client hooks.

func (*PortChannelInterfaceClient) Query added in v0.2.0

Query returns a query builder for PortChannelInterface.

func (*PortChannelInterfaceClient) QueryHaveVlans added in v0.2.0

QueryHaveVlans queries the have_vlans edge of a PortChannelInterface.

func (*PortChannelInterfaceClient) QueryInterfaces added in v0.2.0

QueryInterfaces queries the interfaces edge of a PortChannelInterface.

func (*PortChannelInterfaceClient) QueryMode added in v0.2.0

QueryMode queries the mode edge of a PortChannelInterface.

func (*PortChannelInterfaceClient) QueryNativeOnVlan added in v0.2.0

func (c *PortChannelInterfaceClient) QueryNativeOnVlan(pci *PortChannelInterface) *VlanQuery

QueryNativeOnVlan queries the native_on_vlan edge of a PortChannelInterface.

func (*PortChannelInterfaceClient) QueryOnDevice added in v0.2.0

QueryOnDevice queries the on_device edge of a PortChannelInterface.

func (*PortChannelInterfaceClient) QueryOnIPAddress added in v0.2.0

QueryOnIPAddress queries the on_ip_address edge of a PortChannelInterface.

func (*PortChannelInterfaceClient) QueryOnLayer added in v0.2.0

QueryOnLayer queries the on_layer edge of a PortChannelInterface.

func (*PortChannelInterfaceClient) Update added in v0.2.0

Update returns an update builder for PortChannelInterface.

func (*PortChannelInterfaceClient) UpdateOne added in v0.2.0

UpdateOne returns an update builder for the given entity.

func (*PortChannelInterfaceClient) UpdateOneID added in v0.2.0

UpdateOneID returns an update builder for the given id.

func (*PortChannelInterfaceClient) Use added in v0.2.0

func (c *PortChannelInterfaceClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `portchannelinterface.Hooks(f(g(h())))`.

type PortChannelInterfaceCreate added in v0.2.0

type PortChannelInterfaceCreate struct {
	// contains filtered or unexported fields
}

PortChannelInterfaceCreate is the builder for creating a PortChannelInterface entity.

func (*PortChannelInterfaceCreate) AddHaveVlanIDs added in v0.2.0

func (pcic *PortChannelInterfaceCreate) AddHaveVlanIDs(ids ...int) *PortChannelInterfaceCreate

AddHaveVlanIDs adds the "have_vlans" edge to the Vlan entity by IDs.

func (*PortChannelInterfaceCreate) AddHaveVlans added in v0.2.0

func (pcic *PortChannelInterfaceCreate) AddHaveVlans(v ...*Vlan) *PortChannelInterfaceCreate

AddHaveVlans adds the "have_vlans" edges to the Vlan entity.

func (*PortChannelInterfaceCreate) AddInterfaceIDs added in v0.2.0

func (pcic *PortChannelInterfaceCreate) AddInterfaceIDs(ids ...int) *PortChannelInterfaceCreate

AddInterfaceIDs adds the "interfaces" edge to the NetInterface entity by IDs.

func (*PortChannelInterfaceCreate) AddInterfaces added in v0.2.0

AddInterfaces adds the "interfaces" edges to the NetInterface entity.

func (*PortChannelInterfaceCreate) Mutation added in v0.2.0

Mutation returns the PortChannelInterfaceMutation object of the builder.

func (*PortChannelInterfaceCreate) Save added in v0.2.0

Save creates the PortChannelInterface in the database.

func (*PortChannelInterfaceCreate) SaveX added in v0.2.0

SaveX calls Save and panics if Save returns an error.

func (*PortChannelInterfaceCreate) SetMode added in v0.2.0

SetMode sets the "mode" edge to the NetInterfaceMode entity.

func (*PortChannelInterfaceCreate) SetModeID added in v0.2.0

SetModeID sets the "mode" edge to the NetInterfaceMode entity by ID.

func (*PortChannelInterfaceCreate) SetNativeOnVlan added in v0.2.0

func (pcic *PortChannelInterfaceCreate) SetNativeOnVlan(v *Vlan) *PortChannelInterfaceCreate

SetNativeOnVlan sets the "native_on_vlan" edge to the Vlan entity.

func (*PortChannelInterfaceCreate) SetNativeOnVlanID added in v0.2.0

func (pcic *PortChannelInterfaceCreate) SetNativeOnVlanID(id int) *PortChannelInterfaceCreate

SetNativeOnVlanID sets the "native_on_vlan" edge to the Vlan entity by ID.

func (*PortChannelInterfaceCreate) SetNillableModeID added in v0.2.0

func (pcic *PortChannelInterfaceCreate) SetNillableModeID(id *int) *PortChannelInterfaceCreate

SetNillableModeID sets the "mode" edge to the NetInterfaceMode entity by ID if the given value is not nil.

func (*PortChannelInterfaceCreate) SetNillableNativeOnVlanID added in v0.2.0

func (pcic *PortChannelInterfaceCreate) SetNillableNativeOnVlanID(id *int) *PortChannelInterfaceCreate

SetNillableNativeOnVlanID sets the "native_on_vlan" edge to the Vlan entity by ID if the given value is not nil.

func (*PortChannelInterfaceCreate) SetNillableOnDeviceID added in v0.2.0

func (pcic *PortChannelInterfaceCreate) SetNillableOnDeviceID(id *int) *PortChannelInterfaceCreate

SetNillableOnDeviceID sets the "on_device" edge to the Device entity by ID if the given value is not nil.

func (*PortChannelInterfaceCreate) SetNillableOnIPAddressID added in v0.2.0

func (pcic *PortChannelInterfaceCreate) SetNillableOnIPAddressID(id *int) *PortChannelInterfaceCreate

SetNillableOnIPAddressID sets the "on_ip_address" edge to the IPAddress entity by ID if the given value is not nil.

func (*PortChannelInterfaceCreate) SetNillableOnLayerID added in v0.2.0

func (pcic *PortChannelInterfaceCreate) SetNillableOnLayerID(id *int) *PortChannelInterfaceCreate

SetNillableOnLayerID sets the "on_layer" edge to the NetInterfaceLayer entity by ID if the given value is not nil.

func (*PortChannelInterfaceCreate) SetNillablePoInterfaceShutdown added in v0.2.0

func (pcic *PortChannelInterfaceCreate) SetNillablePoInterfaceShutdown(b *bool) *PortChannelInterfaceCreate

SetNillablePoInterfaceShutdown sets the "po_interface_shutdown" field if the given value is not nil.

func (*PortChannelInterfaceCreate) SetOnDevice added in v0.2.0

SetOnDevice sets the "on_device" edge to the Device entity.

func (*PortChannelInterfaceCreate) SetOnDeviceID added in v0.2.0

SetOnDeviceID sets the "on_device" edge to the Device entity by ID.

func (*PortChannelInterfaceCreate) SetOnIPAddress added in v0.2.0

SetOnIPAddress sets the "on_ip_address" edge to the IPAddress entity.

func (*PortChannelInterfaceCreate) SetOnIPAddressID added in v0.2.0

func (pcic *PortChannelInterfaceCreate) SetOnIPAddressID(id int) *PortChannelInterfaceCreate

SetOnIPAddressID sets the "on_ip_address" edge to the IPAddress entity by ID.

func (*PortChannelInterfaceCreate) SetOnLayer added in v0.2.0

SetOnLayer sets the "on_layer" edge to the NetInterfaceLayer entity.

func (*PortChannelInterfaceCreate) SetOnLayerID added in v0.2.0

SetOnLayerID sets the "on_layer" edge to the NetInterfaceLayer entity by ID.

func (*PortChannelInterfaceCreate) SetPoInterfaceID added in v0.2.0

func (pcic *PortChannelInterfaceCreate) SetPoInterfaceID(i int) *PortChannelInterfaceCreate

SetPoInterfaceID sets the "po_interface_id" field.

func (*PortChannelInterfaceCreate) SetPoInterfaceShutdown added in v0.2.0

func (pcic *PortChannelInterfaceCreate) SetPoInterfaceShutdown(b bool) *PortChannelInterfaceCreate

SetPoInterfaceShutdown sets the "po_interface_shutdown" field.

type PortChannelInterfaceCreateBulk added in v0.2.0

type PortChannelInterfaceCreateBulk struct {
	// contains filtered or unexported fields
}

PortChannelInterfaceCreateBulk is the builder for creating many PortChannelInterface entities in bulk.

func (*PortChannelInterfaceCreateBulk) Save added in v0.2.0

Save creates the PortChannelInterface entities in the database.

func (*PortChannelInterfaceCreateBulk) SaveX added in v0.2.0

SaveX is like Save, but panics if an error occurs.

type PortChannelInterfaceDelete added in v0.2.0

type PortChannelInterfaceDelete struct {
	// contains filtered or unexported fields
}

PortChannelInterfaceDelete is the builder for deleting a PortChannelInterface entity.

func (*PortChannelInterfaceDelete) Exec added in v0.2.0

func (pcid *PortChannelInterfaceDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*PortChannelInterfaceDelete) ExecX added in v0.2.0

func (pcid *PortChannelInterfaceDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*PortChannelInterfaceDelete) Where added in v0.2.0

Where adds a new predicate to the PortChannelInterfaceDelete builder.

type PortChannelInterfaceDeleteOne added in v0.2.0

type PortChannelInterfaceDeleteOne struct {
	// contains filtered or unexported fields
}

PortChannelInterfaceDeleteOne is the builder for deleting a single PortChannelInterface entity.

func (*PortChannelInterfaceDeleteOne) Exec added in v0.2.0

Exec executes the deletion query.

func (*PortChannelInterfaceDeleteOne) ExecX added in v0.2.0

func (pcido *PortChannelInterfaceDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type PortChannelInterfaceEdges added in v0.2.0

type PortChannelInterfaceEdges struct {
	// Mode holds the value of the mode edge.
	Mode *NetInterfaceMode `json:"mode,omitempty"`
	// OnLayer holds the value of the on_layer edge.
	OnLayer *NetInterfaceLayer `json:"on_layer,omitempty"`
	// HaveVlans holds the value of the have_vlans edge.
	HaveVlans []*Vlan `json:"have_vlans,omitempty"`
	// NativeOnVlan holds the value of the native_on_vlan edge.
	NativeOnVlan *Vlan `json:"native_on_vlan,omitempty"`
	// OnDevice holds the value of the on_device edge.
	OnDevice *Device `json:"on_device,omitempty"`
	// OnIPAddress holds the value of the on_ip_address edge.
	OnIPAddress *IPAddress `json:"on_ip_address,omitempty"`
	// Interfaces holds the value of the interfaces edge.
	Interfaces []*NetInterface `json:"interfaces,omitempty"`
	// contains filtered or unexported fields
}

PortChannelInterfaceEdges holds the relations/edges for other nodes in the graph.

func (PortChannelInterfaceEdges) HaveVlansOrErr added in v0.2.0

func (e PortChannelInterfaceEdges) HaveVlansOrErr() ([]*Vlan, error)

HaveVlansOrErr returns the HaveVlans value or an error if the edge was not loaded in eager-loading.

func (PortChannelInterfaceEdges) InterfacesOrErr added in v0.2.0

func (e PortChannelInterfaceEdges) InterfacesOrErr() ([]*NetInterface, error)

InterfacesOrErr returns the Interfaces value or an error if the edge was not loaded in eager-loading.

func (PortChannelInterfaceEdges) ModeOrErr added in v0.2.0

ModeOrErr returns the Mode value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (PortChannelInterfaceEdges) NativeOnVlanOrErr added in v0.2.0

func (e PortChannelInterfaceEdges) NativeOnVlanOrErr() (*Vlan, error)

NativeOnVlanOrErr returns the NativeOnVlan value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (PortChannelInterfaceEdges) OnDeviceOrErr added in v0.2.0

func (e PortChannelInterfaceEdges) OnDeviceOrErr() (*Device, error)

OnDeviceOrErr returns the OnDevice value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (PortChannelInterfaceEdges) OnIPAddressOrErr added in v0.2.0

func (e PortChannelInterfaceEdges) OnIPAddressOrErr() (*IPAddress, error)

OnIPAddressOrErr returns the OnIPAddress value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (PortChannelInterfaceEdges) OnLayerOrErr added in v0.2.0

func (e PortChannelInterfaceEdges) OnLayerOrErr() (*NetInterfaceLayer, error)

OnLayerOrErr returns the OnLayer value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type PortChannelInterfaceGroupBy added in v0.2.0

type PortChannelInterfaceGroupBy struct {
	// contains filtered or unexported fields
}

PortChannelInterfaceGroupBy is the group-by builder for PortChannelInterface entities.

func (*PortChannelInterfaceGroupBy) Aggregate added in v0.2.0

Aggregate adds the given aggregation functions to the group-by query.

func (*PortChannelInterfaceGroupBy) Bool added in v0.2.0

func (pcigb *PortChannelInterfaceGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*PortChannelInterfaceGroupBy) BoolX added in v0.2.0

func (pcigb *PortChannelInterfaceGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PortChannelInterfaceGroupBy) Bools added in v0.2.0

func (pcigb *PortChannelInterfaceGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*PortChannelInterfaceGroupBy) BoolsX added in v0.2.0

func (pcigb *PortChannelInterfaceGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PortChannelInterfaceGroupBy) Float64 added in v0.2.0

func (pcigb *PortChannelInterfaceGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*PortChannelInterfaceGroupBy) Float64X added in v0.2.0

func (pcigb *PortChannelInterfaceGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PortChannelInterfaceGroupBy) Float64s added in v0.2.0

func (pcigb *PortChannelInterfaceGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*PortChannelInterfaceGroupBy) Float64sX added in v0.2.0

func (pcigb *PortChannelInterfaceGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PortChannelInterfaceGroupBy) Int added in v0.2.0

func (pcigb *PortChannelInterfaceGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*PortChannelInterfaceGroupBy) IntX added in v0.2.0

IntX is like Int, but panics if an error occurs.

func (*PortChannelInterfaceGroupBy) Ints added in v0.2.0

func (pcigb *PortChannelInterfaceGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*PortChannelInterfaceGroupBy) IntsX added in v0.2.0

func (pcigb *PortChannelInterfaceGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PortChannelInterfaceGroupBy) Scan added in v0.2.0

func (pcigb *PortChannelInterfaceGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*PortChannelInterfaceGroupBy) ScanX added in v0.2.0

func (pcigb *PortChannelInterfaceGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*PortChannelInterfaceGroupBy) String added in v0.2.0

func (pcigb *PortChannelInterfaceGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*PortChannelInterfaceGroupBy) StringX added in v0.2.0

func (pcigb *PortChannelInterfaceGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PortChannelInterfaceGroupBy) Strings added in v0.2.0

func (pcigb *PortChannelInterfaceGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*PortChannelInterfaceGroupBy) StringsX added in v0.2.0

func (pcigb *PortChannelInterfaceGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PortChannelInterfaceMutation added in v0.2.0

type PortChannelInterfaceMutation struct {
	// contains filtered or unexported fields
}

PortChannelInterfaceMutation represents an operation that mutates the PortChannelInterface nodes in the graph.

func (*PortChannelInterfaceMutation) AddField added in v0.2.0

func (m *PortChannelInterfaceMutation) 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 (*PortChannelInterfaceMutation) AddHaveVlanIDs added in v0.2.0

func (m *PortChannelInterfaceMutation) AddHaveVlanIDs(ids ...int)

AddHaveVlanIDs adds the "have_vlans" edge to the Vlan entity by ids.

func (*PortChannelInterfaceMutation) AddInterfaceIDs added in v0.2.0

func (m *PortChannelInterfaceMutation) AddInterfaceIDs(ids ...int)

AddInterfaceIDs adds the "interfaces" edge to the NetInterface entity by ids.

func (*PortChannelInterfaceMutation) AddPoInterfaceID added in v0.2.0

func (m *PortChannelInterfaceMutation) AddPoInterfaceID(i int)

AddPoInterfaceID adds i to the "po_interface_id" field.

func (*PortChannelInterfaceMutation) AddedEdges added in v0.2.0

func (m *PortChannelInterfaceMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*PortChannelInterfaceMutation) AddedField added in v0.2.0

func (m *PortChannelInterfaceMutation) 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 (*PortChannelInterfaceMutation) AddedFields added in v0.2.0

func (m *PortChannelInterfaceMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*PortChannelInterfaceMutation) AddedIDs added in v0.2.0

func (m *PortChannelInterfaceMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*PortChannelInterfaceMutation) AddedPoInterfaceID added in v0.2.0

func (m *PortChannelInterfaceMutation) AddedPoInterfaceID() (r int, exists bool)

AddedPoInterfaceID returns the value that was added to the "po_interface_id" field in this mutation.

func (*PortChannelInterfaceMutation) ClearEdge added in v0.2.0

func (m *PortChannelInterfaceMutation) 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 (*PortChannelInterfaceMutation) ClearField added in v0.2.0

func (m *PortChannelInterfaceMutation) 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 (*PortChannelInterfaceMutation) ClearHaveVlans added in v0.2.0

func (m *PortChannelInterfaceMutation) ClearHaveVlans()

ClearHaveVlans clears the "have_vlans" edge to the Vlan entity.

func (*PortChannelInterfaceMutation) ClearInterfaces added in v0.2.0

func (m *PortChannelInterfaceMutation) ClearInterfaces()

ClearInterfaces clears the "interfaces" edge to the NetInterface entity.

func (*PortChannelInterfaceMutation) ClearMode added in v0.2.0

func (m *PortChannelInterfaceMutation) ClearMode()

ClearMode clears the "mode" edge to the NetInterfaceMode entity.

func (*PortChannelInterfaceMutation) ClearNativeOnVlan added in v0.2.0

func (m *PortChannelInterfaceMutation) ClearNativeOnVlan()

ClearNativeOnVlan clears the "native_on_vlan" edge to the Vlan entity.

func (*PortChannelInterfaceMutation) ClearOnDevice added in v0.2.0

func (m *PortChannelInterfaceMutation) ClearOnDevice()

ClearOnDevice clears the "on_device" edge to the Device entity.

func (*PortChannelInterfaceMutation) ClearOnIPAddress added in v0.2.0

func (m *PortChannelInterfaceMutation) ClearOnIPAddress()

ClearOnIPAddress clears the "on_ip_address" edge to the IPAddress entity.

func (*PortChannelInterfaceMutation) ClearOnLayer added in v0.2.0

func (m *PortChannelInterfaceMutation) ClearOnLayer()

ClearOnLayer clears the "on_layer" edge to the NetInterfaceLayer entity.

func (*PortChannelInterfaceMutation) ClearedEdges added in v0.2.0

func (m *PortChannelInterfaceMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*PortChannelInterfaceMutation) ClearedFields added in v0.2.0

func (m *PortChannelInterfaceMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (PortChannelInterfaceMutation) Client added in v0.2.0

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 (*PortChannelInterfaceMutation) EdgeCleared added in v0.2.0

func (m *PortChannelInterfaceMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*PortChannelInterfaceMutation) Field added in v0.2.0

func (m *PortChannelInterfaceMutation) 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 (*PortChannelInterfaceMutation) FieldCleared added in v0.2.0

func (m *PortChannelInterfaceMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*PortChannelInterfaceMutation) Fields added in v0.2.0

func (m *PortChannelInterfaceMutation) 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 (*PortChannelInterfaceMutation) HaveVlansCleared added in v0.2.0

func (m *PortChannelInterfaceMutation) HaveVlansCleared() bool

HaveVlansCleared reports if the "have_vlans" edge to the Vlan entity was cleared.

func (*PortChannelInterfaceMutation) HaveVlansIDs added in v0.2.0

func (m *PortChannelInterfaceMutation) HaveVlansIDs() (ids []int)

HaveVlansIDs returns the "have_vlans" edge IDs in the mutation.

func (*PortChannelInterfaceMutation) ID added in v0.2.0

func (m *PortChannelInterfaceMutation) 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.

func (*PortChannelInterfaceMutation) InterfacesCleared added in v0.2.0

func (m *PortChannelInterfaceMutation) InterfacesCleared() bool

InterfacesCleared reports if the "interfaces" edge to the NetInterface entity was cleared.

func (*PortChannelInterfaceMutation) InterfacesIDs added in v0.2.0

func (m *PortChannelInterfaceMutation) InterfacesIDs() (ids []int)

InterfacesIDs returns the "interfaces" edge IDs in the mutation.

func (*PortChannelInterfaceMutation) ModeCleared added in v0.2.0

func (m *PortChannelInterfaceMutation) ModeCleared() bool

ModeCleared reports if the "mode" edge to the NetInterfaceMode entity was cleared.

func (*PortChannelInterfaceMutation) ModeID added in v0.2.0

func (m *PortChannelInterfaceMutation) ModeID() (id int, exists bool)

ModeID returns the "mode" edge ID in the mutation.

func (*PortChannelInterfaceMutation) ModeIDs added in v0.2.0

func (m *PortChannelInterfaceMutation) ModeIDs() (ids []int)

ModeIDs returns the "mode" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ModeID instead. It exists only for internal usage by the builders.

func (*PortChannelInterfaceMutation) NativeOnVlanCleared added in v0.2.0

func (m *PortChannelInterfaceMutation) NativeOnVlanCleared() bool

NativeOnVlanCleared reports if the "native_on_vlan" edge to the Vlan entity was cleared.

func (*PortChannelInterfaceMutation) NativeOnVlanID added in v0.2.0

func (m *PortChannelInterfaceMutation) NativeOnVlanID() (id int, exists bool)

NativeOnVlanID returns the "native_on_vlan" edge ID in the mutation.

func (*PortChannelInterfaceMutation) NativeOnVlanIDs added in v0.2.0

func (m *PortChannelInterfaceMutation) NativeOnVlanIDs() (ids []int)

NativeOnVlanIDs returns the "native_on_vlan" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use NativeOnVlanID instead. It exists only for internal usage by the builders.

func (*PortChannelInterfaceMutation) OldField added in v0.2.0

func (m *PortChannelInterfaceMutation) 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 (*PortChannelInterfaceMutation) OldPoInterfaceID added in v0.2.0

func (m *PortChannelInterfaceMutation) OldPoInterfaceID(ctx context.Context) (v int, err error)

OldPoInterfaceID returns the old "po_interface_id" field's value of the PortChannelInterface entity. If the PortChannelInterface 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 (*PortChannelInterfaceMutation) OldPoInterfaceShutdown added in v0.2.0

func (m *PortChannelInterfaceMutation) OldPoInterfaceShutdown(ctx context.Context) (v bool, err error)

OldPoInterfaceShutdown returns the old "po_interface_shutdown" field's value of the PortChannelInterface entity. If the PortChannelInterface 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 (*PortChannelInterfaceMutation) OnDeviceCleared added in v0.2.0

func (m *PortChannelInterfaceMutation) OnDeviceCleared() bool

OnDeviceCleared reports if the "on_device" edge to the Device entity was cleared.

func (*PortChannelInterfaceMutation) OnDeviceID added in v0.2.0

func (m *PortChannelInterfaceMutation) OnDeviceID() (id int, exists bool)

OnDeviceID returns the "on_device" edge ID in the mutation.

func (*PortChannelInterfaceMutation) OnDeviceIDs added in v0.2.0

func (m *PortChannelInterfaceMutation) OnDeviceIDs() (ids []int)

OnDeviceIDs returns the "on_device" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use OnDeviceID instead. It exists only for internal usage by the builders.

func (*PortChannelInterfaceMutation) OnIPAddressCleared added in v0.2.0

func (m *PortChannelInterfaceMutation) OnIPAddressCleared() bool

OnIPAddressCleared reports if the "on_ip_address" edge to the IPAddress entity was cleared.

func (*PortChannelInterfaceMutation) OnIPAddressID added in v0.2.0

func (m *PortChannelInterfaceMutation) OnIPAddressID() (id int, exists bool)

OnIPAddressID returns the "on_ip_address" edge ID in the mutation.

func (*PortChannelInterfaceMutation) OnIPAddressIDs added in v0.2.0

func (m *PortChannelInterfaceMutation) OnIPAddressIDs() (ids []int)

OnIPAddressIDs returns the "on_ip_address" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use OnIPAddressID instead. It exists only for internal usage by the builders.

func (*PortChannelInterfaceMutation) OnLayerCleared added in v0.2.0

func (m *PortChannelInterfaceMutation) OnLayerCleared() bool

OnLayerCleared reports if the "on_layer" edge to the NetInterfaceLayer entity was cleared.

func (*PortChannelInterfaceMutation) OnLayerID added in v0.2.0

func (m *PortChannelInterfaceMutation) OnLayerID() (id int, exists bool)

OnLayerID returns the "on_layer" edge ID in the mutation.

func (*PortChannelInterfaceMutation) OnLayerIDs added in v0.2.0

func (m *PortChannelInterfaceMutation) OnLayerIDs() (ids []int)

OnLayerIDs returns the "on_layer" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use OnLayerID instead. It exists only for internal usage by the builders.

func (*PortChannelInterfaceMutation) Op added in v0.2.0

Op returns the operation name.

func (*PortChannelInterfaceMutation) PoInterfaceID added in v0.2.0

func (m *PortChannelInterfaceMutation) PoInterfaceID() (r int, exists bool)

PoInterfaceID returns the value of the "po_interface_id" field in the mutation.

func (*PortChannelInterfaceMutation) PoInterfaceShutdown added in v0.2.0

func (m *PortChannelInterfaceMutation) PoInterfaceShutdown() (r bool, exists bool)

PoInterfaceShutdown returns the value of the "po_interface_shutdown" field in the mutation.

func (*PortChannelInterfaceMutation) RemoveHaveVlanIDs added in v0.2.0

func (m *PortChannelInterfaceMutation) RemoveHaveVlanIDs(ids ...int)

RemoveHaveVlanIDs removes the "have_vlans" edge to the Vlan entity by IDs.

func (*PortChannelInterfaceMutation) RemoveInterfaceIDs added in v0.2.0

func (m *PortChannelInterfaceMutation) RemoveInterfaceIDs(ids ...int)

RemoveInterfaceIDs removes the "interfaces" edge to the NetInterface entity by IDs.

func (*PortChannelInterfaceMutation) RemovedEdges added in v0.2.0

func (m *PortChannelInterfaceMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*PortChannelInterfaceMutation) RemovedHaveVlansIDs added in v0.2.0

func (m *PortChannelInterfaceMutation) RemovedHaveVlansIDs() (ids []int)

RemovedHaveVlans returns the removed IDs of the "have_vlans" edge to the Vlan entity.

func (*PortChannelInterfaceMutation) RemovedIDs added in v0.2.0

func (m *PortChannelInterfaceMutation) 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 (*PortChannelInterfaceMutation) RemovedInterfacesIDs added in v0.2.0

func (m *PortChannelInterfaceMutation) RemovedInterfacesIDs() (ids []int)

RemovedInterfaces returns the removed IDs of the "interfaces" edge to the NetInterface entity.

func (*PortChannelInterfaceMutation) ResetEdge added in v0.2.0

func (m *PortChannelInterfaceMutation) 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 (*PortChannelInterfaceMutation) ResetField added in v0.2.0

func (m *PortChannelInterfaceMutation) 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 (*PortChannelInterfaceMutation) ResetHaveVlans added in v0.2.0

func (m *PortChannelInterfaceMutation) ResetHaveVlans()

ResetHaveVlans resets all changes to the "have_vlans" edge.

func (*PortChannelInterfaceMutation) ResetInterfaces added in v0.2.0

func (m *PortChannelInterfaceMutation) ResetInterfaces()

ResetInterfaces resets all changes to the "interfaces" edge.

func (*PortChannelInterfaceMutation) ResetMode added in v0.2.0

func (m *PortChannelInterfaceMutation) ResetMode()

ResetMode resets all changes to the "mode" edge.

func (*PortChannelInterfaceMutation) ResetNativeOnVlan added in v0.2.0

func (m *PortChannelInterfaceMutation) ResetNativeOnVlan()

ResetNativeOnVlan resets all changes to the "native_on_vlan" edge.

func (*PortChannelInterfaceMutation) ResetOnDevice added in v0.2.0

func (m *PortChannelInterfaceMutation) ResetOnDevice()

ResetOnDevice resets all changes to the "on_device" edge.

func (*PortChannelInterfaceMutation) ResetOnIPAddress added in v0.2.0

func (m *PortChannelInterfaceMutation) ResetOnIPAddress()

ResetOnIPAddress resets all changes to the "on_ip_address" edge.

func (*PortChannelInterfaceMutation) ResetOnLayer added in v0.2.0

func (m *PortChannelInterfaceMutation) ResetOnLayer()

ResetOnLayer resets all changes to the "on_layer" edge.

func (*PortChannelInterfaceMutation) ResetPoInterfaceID added in v0.2.0

func (m *PortChannelInterfaceMutation) ResetPoInterfaceID()

ResetPoInterfaceID resets all changes to the "po_interface_id" field.

func (*PortChannelInterfaceMutation) ResetPoInterfaceShutdown added in v0.2.0

func (m *PortChannelInterfaceMutation) ResetPoInterfaceShutdown()

ResetPoInterfaceShutdown resets all changes to the "po_interface_shutdown" field.

func (*PortChannelInterfaceMutation) SetField added in v0.2.0

func (m *PortChannelInterfaceMutation) 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 (*PortChannelInterfaceMutation) SetModeID added in v0.2.0

func (m *PortChannelInterfaceMutation) SetModeID(id int)

SetModeID sets the "mode" edge to the NetInterfaceMode entity by id.

func (*PortChannelInterfaceMutation) SetNativeOnVlanID added in v0.2.0

func (m *PortChannelInterfaceMutation) SetNativeOnVlanID(id int)

SetNativeOnVlanID sets the "native_on_vlan" edge to the Vlan entity by id.

func (*PortChannelInterfaceMutation) SetOnDeviceID added in v0.2.0

func (m *PortChannelInterfaceMutation) SetOnDeviceID(id int)

SetOnDeviceID sets the "on_device" edge to the Device entity by id.

func (*PortChannelInterfaceMutation) SetOnIPAddressID added in v0.2.0

func (m *PortChannelInterfaceMutation) SetOnIPAddressID(id int)

SetOnIPAddressID sets the "on_ip_address" edge to the IPAddress entity by id.

func (*PortChannelInterfaceMutation) SetOnLayerID added in v0.2.0

func (m *PortChannelInterfaceMutation) SetOnLayerID(id int)

SetOnLayerID sets the "on_layer" edge to the NetInterfaceLayer entity by id.

func (*PortChannelInterfaceMutation) SetPoInterfaceID added in v0.2.0

func (m *PortChannelInterfaceMutation) SetPoInterfaceID(i int)

SetPoInterfaceID sets the "po_interface_id" field.

func (*PortChannelInterfaceMutation) SetPoInterfaceShutdown added in v0.2.0

func (m *PortChannelInterfaceMutation) SetPoInterfaceShutdown(b bool)

SetPoInterfaceShutdown sets the "po_interface_shutdown" field.

func (PortChannelInterfaceMutation) Tx added in v0.2.0

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*PortChannelInterfaceMutation) Type added in v0.2.0

Type returns the node type of this mutation (PortChannelInterface).

type PortChannelInterfaceQuery added in v0.2.0

type PortChannelInterfaceQuery struct {
	// contains filtered or unexported fields
}

PortChannelInterfaceQuery is the builder for querying PortChannelInterface entities.

func (*PortChannelInterfaceQuery) All added in v0.2.0

All executes the query and returns a list of PortChannelInterfaces.

func (*PortChannelInterfaceQuery) AllX added in v0.2.0

AllX is like All, but panics if an error occurs.

func (*PortChannelInterfaceQuery) Clone added in v0.2.0

Clone returns a duplicate of the PortChannelInterfaceQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*PortChannelInterfaceQuery) Count added in v0.2.0

func (pciq *PortChannelInterfaceQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*PortChannelInterfaceQuery) CountX added in v0.2.0

func (pciq *PortChannelInterfaceQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*PortChannelInterfaceQuery) Exist added in v0.2.0

func (pciq *PortChannelInterfaceQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*PortChannelInterfaceQuery) ExistX added in v0.2.0

func (pciq *PortChannelInterfaceQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*PortChannelInterfaceQuery) First added in v0.2.0

First returns the first PortChannelInterface entity from the query. Returns a *NotFoundError when no PortChannelInterface was found.

func (*PortChannelInterfaceQuery) FirstID added in v0.2.0

func (pciq *PortChannelInterfaceQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first PortChannelInterface ID from the query. Returns a *NotFoundError when no PortChannelInterface ID was found.

func (*PortChannelInterfaceQuery) FirstIDX added in v0.2.0

func (pciq *PortChannelInterfaceQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*PortChannelInterfaceQuery) FirstX added in v0.2.0

FirstX is like First, but panics if an error occurs.

func (*PortChannelInterfaceQuery) GroupBy added in v0.2.0

func (pciq *PortChannelInterfaceQuery) GroupBy(field string, fields ...string) *PortChannelInterfaceGroupBy

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 {
	PoInterfaceID int `json:"po_interface_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.PortChannelInterface.Query().
	GroupBy(portchannelinterface.FieldPoInterfaceID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*PortChannelInterfaceQuery) IDs added in v0.2.0

func (pciq *PortChannelInterfaceQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of PortChannelInterface IDs.

func (*PortChannelInterfaceQuery) IDsX added in v0.2.0

func (pciq *PortChannelInterfaceQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*PortChannelInterfaceQuery) Limit added in v0.2.0

Limit adds a limit step to the query.

func (*PortChannelInterfaceQuery) Offset added in v0.2.0

Offset adds an offset step to the query.

func (*PortChannelInterfaceQuery) Only added in v0.2.0

Only returns a single PortChannelInterface entity found by the query, ensuring it only returns one. Returns a *NotSingularError when exactly one PortChannelInterface entity is not found. Returns a *NotFoundError when no PortChannelInterface entities are found.

func (*PortChannelInterfaceQuery) OnlyID added in v0.2.0

func (pciq *PortChannelInterfaceQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only PortChannelInterface ID in the query. Returns a *NotSingularError when exactly one PortChannelInterface ID is not found. Returns a *NotFoundError when no entities are found.

func (*PortChannelInterfaceQuery) OnlyIDX added in v0.2.0

func (pciq *PortChannelInterfaceQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*PortChannelInterfaceQuery) OnlyX added in v0.2.0

OnlyX is like Only, but panics if an error occurs.

func (*PortChannelInterfaceQuery) Order added in v0.2.0

Order adds an order step to the query.

func (*PortChannelInterfaceQuery) QueryHaveVlans added in v0.2.0

func (pciq *PortChannelInterfaceQuery) QueryHaveVlans() *VlanQuery

QueryHaveVlans chains the current query on the "have_vlans" edge.

func (*PortChannelInterfaceQuery) QueryInterfaces added in v0.2.0

func (pciq *PortChannelInterfaceQuery) QueryInterfaces() *NetInterfaceQuery

QueryInterfaces chains the current query on the "interfaces" edge.

func (*PortChannelInterfaceQuery) QueryMode added in v0.2.0

QueryMode chains the current query on the "mode" edge.

func (*PortChannelInterfaceQuery) QueryNativeOnVlan added in v0.2.0

func (pciq *PortChannelInterfaceQuery) QueryNativeOnVlan() *VlanQuery

QueryNativeOnVlan chains the current query on the "native_on_vlan" edge.

func (*PortChannelInterfaceQuery) QueryOnDevice added in v0.2.0

func (pciq *PortChannelInterfaceQuery) QueryOnDevice() *DeviceQuery

QueryOnDevice chains the current query on the "on_device" edge.

func (*PortChannelInterfaceQuery) QueryOnIPAddress added in v0.2.0

func (pciq *PortChannelInterfaceQuery) QueryOnIPAddress() *IPAddressQuery

QueryOnIPAddress chains the current query on the "on_ip_address" edge.

func (*PortChannelInterfaceQuery) QueryOnLayer added in v0.2.0

func (pciq *PortChannelInterfaceQuery) QueryOnLayer() *NetInterfaceLayerQuery

QueryOnLayer chains the current query on the "on_layer" edge.

func (*PortChannelInterfaceQuery) Select added in v0.2.0

func (pciq *PortChannelInterfaceQuery) Select(field string, fields ...string) *PortChannelInterfaceSelect

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 {
	PoInterfaceID int `json:"po_interface_id,omitempty"`
}

client.PortChannelInterface.Query().
	Select(portchannelinterface.FieldPoInterfaceID).
	Scan(ctx, &v)

func (*PortChannelInterfaceQuery) Unique added in v0.2.0

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 (*PortChannelInterfaceQuery) Where added in v0.2.0

Where adds a new predicate for the PortChannelInterfaceQuery builder.

func (*PortChannelInterfaceQuery) WithHaveVlans added in v0.2.0

func (pciq *PortChannelInterfaceQuery) WithHaveVlans(opts ...func(*VlanQuery)) *PortChannelInterfaceQuery

WithHaveVlans tells the query-builder to eager-load the nodes that are connected to the "have_vlans" edge. The optional arguments are used to configure the query builder of the edge.

func (*PortChannelInterfaceQuery) WithInterfaces added in v0.2.0

func (pciq *PortChannelInterfaceQuery) WithInterfaces(opts ...func(*NetInterfaceQuery)) *PortChannelInterfaceQuery

WithInterfaces tells the query-builder to eager-load the nodes that are connected to the "interfaces" edge. The optional arguments are used to configure the query builder of the edge.

func (*PortChannelInterfaceQuery) WithMode added in v0.2.0

WithMode tells the query-builder to eager-load the nodes that are connected to the "mode" edge. The optional arguments are used to configure the query builder of the edge.

func (*PortChannelInterfaceQuery) WithNativeOnVlan added in v0.2.0

func (pciq *PortChannelInterfaceQuery) WithNativeOnVlan(opts ...func(*VlanQuery)) *PortChannelInterfaceQuery

WithNativeOnVlan tells the query-builder to eager-load the nodes that are connected to the "native_on_vlan" edge. The optional arguments are used to configure the query builder of the edge.

func (*PortChannelInterfaceQuery) WithOnDevice added in v0.2.0

func (pciq *PortChannelInterfaceQuery) WithOnDevice(opts ...func(*DeviceQuery)) *PortChannelInterfaceQuery

WithOnDevice tells the query-builder to eager-load the nodes that are connected to the "on_device" edge. The optional arguments are used to configure the query builder of the edge.

func (*PortChannelInterfaceQuery) WithOnIPAddress added in v0.2.0

func (pciq *PortChannelInterfaceQuery) WithOnIPAddress(opts ...func(*IPAddressQuery)) *PortChannelInterfaceQuery

WithOnIPAddress tells the query-builder to eager-load the nodes that are connected to the "on_ip_address" edge. The optional arguments are used to configure the query builder of the edge.

func (*PortChannelInterfaceQuery) WithOnLayer added in v0.2.0

WithOnLayer tells the query-builder to eager-load the nodes that are connected to the "on_layer" edge. The optional arguments are used to configure the query builder of the edge.

type PortChannelInterfaceSelect added in v0.2.0

type PortChannelInterfaceSelect struct {
	*PortChannelInterfaceQuery
	// contains filtered or unexported fields
}

PortChannelInterfaceSelect is the builder for selecting fields of PortChannelInterface entities.

func (*PortChannelInterfaceSelect) Bool added in v0.2.0

func (pcis *PortChannelInterfaceSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PortChannelInterfaceSelect) BoolX added in v0.2.0

BoolX is like Bool, but panics if an error occurs.

func (*PortChannelInterfaceSelect) Bools added in v0.2.0

func (pcis *PortChannelInterfaceSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PortChannelInterfaceSelect) BoolsX added in v0.2.0

func (pcis *PortChannelInterfaceSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PortChannelInterfaceSelect) Float64 added in v0.2.0

func (pcis *PortChannelInterfaceSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PortChannelInterfaceSelect) Float64X added in v0.2.0

func (pcis *PortChannelInterfaceSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PortChannelInterfaceSelect) Float64s added in v0.2.0

func (pcis *PortChannelInterfaceSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PortChannelInterfaceSelect) Float64sX added in v0.2.0

func (pcis *PortChannelInterfaceSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PortChannelInterfaceSelect) Int added in v0.2.0

func (pcis *PortChannelInterfaceSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PortChannelInterfaceSelect) IntX added in v0.2.0

IntX is like Int, but panics if an error occurs.

func (*PortChannelInterfaceSelect) Ints added in v0.2.0

func (pcis *PortChannelInterfaceSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PortChannelInterfaceSelect) IntsX added in v0.2.0

func (pcis *PortChannelInterfaceSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PortChannelInterfaceSelect) Scan added in v0.2.0

func (pcis *PortChannelInterfaceSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*PortChannelInterfaceSelect) ScanX added in v0.2.0

func (pcis *PortChannelInterfaceSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*PortChannelInterfaceSelect) String added in v0.2.0

func (pcis *PortChannelInterfaceSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PortChannelInterfaceSelect) StringX added in v0.2.0

func (pcis *PortChannelInterfaceSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PortChannelInterfaceSelect) Strings added in v0.2.0

func (pcis *PortChannelInterfaceSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PortChannelInterfaceSelect) StringsX added in v0.2.0

func (pcis *PortChannelInterfaceSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PortChannelInterfaceUpdate added in v0.2.0

type PortChannelInterfaceUpdate struct {
	// contains filtered or unexported fields
}

PortChannelInterfaceUpdate is the builder for updating PortChannelInterface entities.

func (*PortChannelInterfaceUpdate) AddHaveVlanIDs added in v0.2.0

func (pciu *PortChannelInterfaceUpdate) AddHaveVlanIDs(ids ...int) *PortChannelInterfaceUpdate

AddHaveVlanIDs adds the "have_vlans" edge to the Vlan entity by IDs.

func (*PortChannelInterfaceUpdate) AddHaveVlans added in v0.2.0

func (pciu *PortChannelInterfaceUpdate) AddHaveVlans(v ...*Vlan) *PortChannelInterfaceUpdate

AddHaveVlans adds the "have_vlans" edges to the Vlan entity.

func (*PortChannelInterfaceUpdate) AddInterfaceIDs added in v0.2.0

func (pciu *PortChannelInterfaceUpdate) AddInterfaceIDs(ids ...int) *PortChannelInterfaceUpdate

AddInterfaceIDs adds the "interfaces" edge to the NetInterface entity by IDs.

func (*PortChannelInterfaceUpdate) AddInterfaces added in v0.2.0

AddInterfaces adds the "interfaces" edges to the NetInterface entity.

func (*PortChannelInterfaceUpdate) AddPoInterfaceID added in v0.2.0

func (pciu *PortChannelInterfaceUpdate) AddPoInterfaceID(i int) *PortChannelInterfaceUpdate

AddPoInterfaceID adds i to the "po_interface_id" field.

func (*PortChannelInterfaceUpdate) ClearHaveVlans added in v0.2.0

ClearHaveVlans clears all "have_vlans" edges to the Vlan entity.

func (*PortChannelInterfaceUpdate) ClearInterfaces added in v0.2.0

func (pciu *PortChannelInterfaceUpdate) ClearInterfaces() *PortChannelInterfaceUpdate

ClearInterfaces clears all "interfaces" edges to the NetInterface entity.

func (*PortChannelInterfaceUpdate) ClearMode added in v0.2.0

ClearMode clears the "mode" edge to the NetInterfaceMode entity.

func (*PortChannelInterfaceUpdate) ClearNativeOnVlan added in v0.2.0

func (pciu *PortChannelInterfaceUpdate) ClearNativeOnVlan() *PortChannelInterfaceUpdate

ClearNativeOnVlan clears the "native_on_vlan" edge to the Vlan entity.

func (*PortChannelInterfaceUpdate) ClearOnDevice added in v0.2.0

ClearOnDevice clears the "on_device" edge to the Device entity.

func (*PortChannelInterfaceUpdate) ClearOnIPAddress added in v0.2.0

func (pciu *PortChannelInterfaceUpdate) ClearOnIPAddress() *PortChannelInterfaceUpdate

ClearOnIPAddress clears the "on_ip_address" edge to the IPAddress entity.

func (*PortChannelInterfaceUpdate) ClearOnLayer added in v0.2.0

ClearOnLayer clears the "on_layer" edge to the NetInterfaceLayer entity.

func (*PortChannelInterfaceUpdate) Exec added in v0.2.0

Exec executes the query.

func (*PortChannelInterfaceUpdate) ExecX added in v0.2.0

func (pciu *PortChannelInterfaceUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PortChannelInterfaceUpdate) Mutation added in v0.2.0

Mutation returns the PortChannelInterfaceMutation object of the builder.

func (*PortChannelInterfaceUpdate) RemoveHaveVlanIDs added in v0.2.0

func (pciu *PortChannelInterfaceUpdate) RemoveHaveVlanIDs(ids ...int) *PortChannelInterfaceUpdate

RemoveHaveVlanIDs removes the "have_vlans" edge to Vlan entities by IDs.

func (*PortChannelInterfaceUpdate) RemoveHaveVlans added in v0.2.0

func (pciu *PortChannelInterfaceUpdate) RemoveHaveVlans(v ...*Vlan) *PortChannelInterfaceUpdate

RemoveHaveVlans removes "have_vlans" edges to Vlan entities.

func (*PortChannelInterfaceUpdate) RemoveInterfaceIDs added in v0.2.0

func (pciu *PortChannelInterfaceUpdate) RemoveInterfaceIDs(ids ...int) *PortChannelInterfaceUpdate

RemoveInterfaceIDs removes the "interfaces" edge to NetInterface entities by IDs.

func (*PortChannelInterfaceUpdate) RemoveInterfaces added in v0.2.0

RemoveInterfaces removes "interfaces" edges to NetInterface entities.

func (*PortChannelInterfaceUpdate) Save added in v0.2.0

func (pciu *PortChannelInterfaceUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*PortChannelInterfaceUpdate) SaveX added in v0.2.0

func (pciu *PortChannelInterfaceUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*PortChannelInterfaceUpdate) SetMode added in v0.2.0

SetMode sets the "mode" edge to the NetInterfaceMode entity.

func (*PortChannelInterfaceUpdate) SetModeID added in v0.2.0

SetModeID sets the "mode" edge to the NetInterfaceMode entity by ID.

func (*PortChannelInterfaceUpdate) SetNativeOnVlan added in v0.2.0

func (pciu *PortChannelInterfaceUpdate) SetNativeOnVlan(v *Vlan) *PortChannelInterfaceUpdate

SetNativeOnVlan sets the "native_on_vlan" edge to the Vlan entity.

func (*PortChannelInterfaceUpdate) SetNativeOnVlanID added in v0.2.0

func (pciu *PortChannelInterfaceUpdate) SetNativeOnVlanID(id int) *PortChannelInterfaceUpdate

SetNativeOnVlanID sets the "native_on_vlan" edge to the Vlan entity by ID.

func (*PortChannelInterfaceUpdate) SetNillableModeID added in v0.2.0

func (pciu *PortChannelInterfaceUpdate) SetNillableModeID(id *int) *PortChannelInterfaceUpdate

SetNillableModeID sets the "mode" edge to the NetInterfaceMode entity by ID if the given value is not nil.

func (*PortChannelInterfaceUpdate) SetNillableNativeOnVlanID added in v0.2.0

func (pciu *PortChannelInterfaceUpdate) SetNillableNativeOnVlanID(id *int) *PortChannelInterfaceUpdate

SetNillableNativeOnVlanID sets the "native_on_vlan" edge to the Vlan entity by ID if the given value is not nil.

func (*PortChannelInterfaceUpdate) SetNillableOnDeviceID added in v0.2.0

func (pciu *PortChannelInterfaceUpdate) SetNillableOnDeviceID(id *int) *PortChannelInterfaceUpdate

SetNillableOnDeviceID sets the "on_device" edge to the Device entity by ID if the given value is not nil.

func (*PortChannelInterfaceUpdate) SetNillableOnIPAddressID added in v0.2.0

func (pciu *PortChannelInterfaceUpdate) SetNillableOnIPAddressID(id *int) *PortChannelInterfaceUpdate

SetNillableOnIPAddressID sets the "on_ip_address" edge to the IPAddress entity by ID if the given value is not nil.

func (*PortChannelInterfaceUpdate) SetNillableOnLayerID added in v0.2.0

func (pciu *PortChannelInterfaceUpdate) SetNillableOnLayerID(id *int) *PortChannelInterfaceUpdate

SetNillableOnLayerID sets the "on_layer" edge to the NetInterfaceLayer entity by ID if the given value is not nil.

func (*PortChannelInterfaceUpdate) SetNillablePoInterfaceShutdown added in v0.2.0

func (pciu *PortChannelInterfaceUpdate) SetNillablePoInterfaceShutdown(b *bool) *PortChannelInterfaceUpdate

SetNillablePoInterfaceShutdown sets the "po_interface_shutdown" field if the given value is not nil.

func (*PortChannelInterfaceUpdate) SetOnDevice added in v0.2.0

SetOnDevice sets the "on_device" edge to the Device entity.

func (*PortChannelInterfaceUpdate) SetOnDeviceID added in v0.2.0

SetOnDeviceID sets the "on_device" edge to the Device entity by ID.

func (*PortChannelInterfaceUpdate) SetOnIPAddress added in v0.2.0

SetOnIPAddress sets the "on_ip_address" edge to the IPAddress entity.

func (*PortChannelInterfaceUpdate) SetOnIPAddressID added in v0.2.0

func (pciu *PortChannelInterfaceUpdate) SetOnIPAddressID(id int) *PortChannelInterfaceUpdate

SetOnIPAddressID sets the "on_ip_address" edge to the IPAddress entity by ID.

func (*PortChannelInterfaceUpdate) SetOnLayer added in v0.2.0

SetOnLayer sets the "on_layer" edge to the NetInterfaceLayer entity.

func (*PortChannelInterfaceUpdate) SetOnLayerID added in v0.2.0

SetOnLayerID sets the "on_layer" edge to the NetInterfaceLayer entity by ID.

func (*PortChannelInterfaceUpdate) SetPoInterfaceID added in v0.2.0

func (pciu *PortChannelInterfaceUpdate) SetPoInterfaceID(i int) *PortChannelInterfaceUpdate

SetPoInterfaceID sets the "po_interface_id" field.

func (*PortChannelInterfaceUpdate) SetPoInterfaceShutdown added in v0.2.0

func (pciu *PortChannelInterfaceUpdate) SetPoInterfaceShutdown(b bool) *PortChannelInterfaceUpdate

SetPoInterfaceShutdown sets the "po_interface_shutdown" field.

func (*PortChannelInterfaceUpdate) Where added in v0.2.0

Where adds a new predicate for the PortChannelInterfaceUpdate builder.

type PortChannelInterfaceUpdateOne added in v0.2.0

type PortChannelInterfaceUpdateOne struct {
	// contains filtered or unexported fields
}

PortChannelInterfaceUpdateOne is the builder for updating a single PortChannelInterface entity.

func (*PortChannelInterfaceUpdateOne) AddHaveVlanIDs added in v0.2.0

func (pciuo *PortChannelInterfaceUpdateOne) AddHaveVlanIDs(ids ...int) *PortChannelInterfaceUpdateOne

AddHaveVlanIDs adds the "have_vlans" edge to the Vlan entity by IDs.

func (*PortChannelInterfaceUpdateOne) AddHaveVlans added in v0.2.0

AddHaveVlans adds the "have_vlans" edges to the Vlan entity.

func (*PortChannelInterfaceUpdateOne) AddInterfaceIDs added in v0.2.0

func (pciuo *PortChannelInterfaceUpdateOne) AddInterfaceIDs(ids ...int) *PortChannelInterfaceUpdateOne

AddInterfaceIDs adds the "interfaces" edge to the NetInterface entity by IDs.

func (*PortChannelInterfaceUpdateOne) AddInterfaces added in v0.2.0

AddInterfaces adds the "interfaces" edges to the NetInterface entity.

func (*PortChannelInterfaceUpdateOne) AddPoInterfaceID added in v0.2.0

AddPoInterfaceID adds i to the "po_interface_id" field.

func (*PortChannelInterfaceUpdateOne) ClearHaveVlans added in v0.2.0

ClearHaveVlans clears all "have_vlans" edges to the Vlan entity.

func (*PortChannelInterfaceUpdateOne) ClearInterfaces added in v0.2.0

ClearInterfaces clears all "interfaces" edges to the NetInterface entity.

func (*PortChannelInterfaceUpdateOne) ClearMode added in v0.2.0

ClearMode clears the "mode" edge to the NetInterfaceMode entity.

func (*PortChannelInterfaceUpdateOne) ClearNativeOnVlan added in v0.2.0

ClearNativeOnVlan clears the "native_on_vlan" edge to the Vlan entity.

func (*PortChannelInterfaceUpdateOne) ClearOnDevice added in v0.2.0

ClearOnDevice clears the "on_device" edge to the Device entity.

func (*PortChannelInterfaceUpdateOne) ClearOnIPAddress added in v0.2.0

ClearOnIPAddress clears the "on_ip_address" edge to the IPAddress entity.

func (*PortChannelInterfaceUpdateOne) ClearOnLayer added in v0.2.0

ClearOnLayer clears the "on_layer" edge to the NetInterfaceLayer entity.

func (*PortChannelInterfaceUpdateOne) Exec added in v0.2.0

Exec executes the query on the entity.

func (*PortChannelInterfaceUpdateOne) ExecX added in v0.2.0

func (pciuo *PortChannelInterfaceUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PortChannelInterfaceUpdateOne) Mutation added in v0.2.0

Mutation returns the PortChannelInterfaceMutation object of the builder.

func (*PortChannelInterfaceUpdateOne) RemoveHaveVlanIDs added in v0.2.0

func (pciuo *PortChannelInterfaceUpdateOne) RemoveHaveVlanIDs(ids ...int) *PortChannelInterfaceUpdateOne

RemoveHaveVlanIDs removes the "have_vlans" edge to Vlan entities by IDs.

func (*PortChannelInterfaceUpdateOne) RemoveHaveVlans added in v0.2.0

func (pciuo *PortChannelInterfaceUpdateOne) RemoveHaveVlans(v ...*Vlan) *PortChannelInterfaceUpdateOne

RemoveHaveVlans removes "have_vlans" edges to Vlan entities.

func (*PortChannelInterfaceUpdateOne) RemoveInterfaceIDs added in v0.2.0

func (pciuo *PortChannelInterfaceUpdateOne) RemoveInterfaceIDs(ids ...int) *PortChannelInterfaceUpdateOne

RemoveInterfaceIDs removes the "interfaces" edge to NetInterface entities by IDs.

func (*PortChannelInterfaceUpdateOne) RemoveInterfaces added in v0.2.0

RemoveInterfaces removes "interfaces" edges to NetInterface entities.

func (*PortChannelInterfaceUpdateOne) Save added in v0.2.0

Save executes the query and returns the updated PortChannelInterface entity.

func (*PortChannelInterfaceUpdateOne) SaveX added in v0.2.0

SaveX is like Save, but panics if an error occurs.

func (*PortChannelInterfaceUpdateOne) Select added in v0.2.0

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*PortChannelInterfaceUpdateOne) SetMode added in v0.2.0

SetMode sets the "mode" edge to the NetInterfaceMode entity.

func (*PortChannelInterfaceUpdateOne) SetModeID added in v0.2.0

SetModeID sets the "mode" edge to the NetInterfaceMode entity by ID.

func (*PortChannelInterfaceUpdateOne) SetNativeOnVlan added in v0.2.0

SetNativeOnVlan sets the "native_on_vlan" edge to the Vlan entity.

func (*PortChannelInterfaceUpdateOne) SetNativeOnVlanID added in v0.2.0

func (pciuo *PortChannelInterfaceUpdateOne) SetNativeOnVlanID(id int) *PortChannelInterfaceUpdateOne

SetNativeOnVlanID sets the "native_on_vlan" edge to the Vlan entity by ID.

func (*PortChannelInterfaceUpdateOne) SetNillableModeID added in v0.2.0

func (pciuo *PortChannelInterfaceUpdateOne) SetNillableModeID(id *int) *PortChannelInterfaceUpdateOne

SetNillableModeID sets the "mode" edge to the NetInterfaceMode entity by ID if the given value is not nil.

func (*PortChannelInterfaceUpdateOne) SetNillableNativeOnVlanID added in v0.2.0

func (pciuo *PortChannelInterfaceUpdateOne) SetNillableNativeOnVlanID(id *int) *PortChannelInterfaceUpdateOne

SetNillableNativeOnVlanID sets the "native_on_vlan" edge to the Vlan entity by ID if the given value is not nil.

func (*PortChannelInterfaceUpdateOne) SetNillableOnDeviceID added in v0.2.0

func (pciuo *PortChannelInterfaceUpdateOne) SetNillableOnDeviceID(id *int) *PortChannelInterfaceUpdateOne

SetNillableOnDeviceID sets the "on_device" edge to the Device entity by ID if the given value is not nil.

func (*PortChannelInterfaceUpdateOne) SetNillableOnIPAddressID added in v0.2.0

func (pciuo *PortChannelInterfaceUpdateOne) SetNillableOnIPAddressID(id *int) *PortChannelInterfaceUpdateOne

SetNillableOnIPAddressID sets the "on_ip_address" edge to the IPAddress entity by ID if the given value is not nil.

func (*PortChannelInterfaceUpdateOne) SetNillableOnLayerID added in v0.2.0

func (pciuo *PortChannelInterfaceUpdateOne) SetNillableOnLayerID(id *int) *PortChannelInterfaceUpdateOne

SetNillableOnLayerID sets the "on_layer" edge to the NetInterfaceLayer entity by ID if the given value is not nil.

func (*PortChannelInterfaceUpdateOne) SetNillablePoInterfaceShutdown added in v0.2.0

func (pciuo *PortChannelInterfaceUpdateOne) SetNillablePoInterfaceShutdown(b *bool) *PortChannelInterfaceUpdateOne

SetNillablePoInterfaceShutdown sets the "po_interface_shutdown" field if the given value is not nil.

func (*PortChannelInterfaceUpdateOne) SetOnDevice added in v0.2.0

SetOnDevice sets the "on_device" edge to the Device entity.

func (*PortChannelInterfaceUpdateOne) SetOnDeviceID added in v0.2.0

SetOnDeviceID sets the "on_device" edge to the Device entity by ID.

func (*PortChannelInterfaceUpdateOne) SetOnIPAddress added in v0.2.0

SetOnIPAddress sets the "on_ip_address" edge to the IPAddress entity.

func (*PortChannelInterfaceUpdateOne) SetOnIPAddressID added in v0.2.0

SetOnIPAddressID sets the "on_ip_address" edge to the IPAddress entity by ID.

func (*PortChannelInterfaceUpdateOne) SetOnLayer added in v0.2.0

SetOnLayer sets the "on_layer" edge to the NetInterfaceLayer entity.

func (*PortChannelInterfaceUpdateOne) SetOnLayerID added in v0.2.0

SetOnLayerID sets the "on_layer" edge to the NetInterfaceLayer entity by ID.

func (*PortChannelInterfaceUpdateOne) SetPoInterfaceID added in v0.2.0

SetPoInterfaceID sets the "po_interface_id" field.

func (*PortChannelInterfaceUpdateOne) SetPoInterfaceShutdown added in v0.2.0

func (pciuo *PortChannelInterfaceUpdateOne) SetPoInterfaceShutdown(b bool) *PortChannelInterfaceUpdateOne

SetPoInterfaceShutdown sets the "po_interface_shutdown" field.

type PortChannelInterfaces added in v0.2.0

type PortChannelInterfaces []*PortChannelInterface

PortChannelInterfaces is a parsable slice of PortChannelInterface.

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(context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Rollback(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollbacker method.

type Tx

type Tx struct {

	// Administrator is the client for interacting with the Administrator builders.
	Administrator *AdministratorClient
	// DeletedVlanLog is the client for interacting with the DeletedVlanLog builders.
	DeletedVlanLog *DeletedVlanLogClient
	// Device is the client for interacting with the Device builders.
	Device *DeviceClient
	// DevicePlatform is the client for interacting with the DevicePlatform builders.
	DevicePlatform *DevicePlatformClient
	// DeviceType is the client for interacting with the DeviceType builders.
	DeviceType *DeviceTypeClient
	// IPAddress is the client for interacting with the IPAddress builders.
	IPAddress *IPAddressClient
	// IPStaticRoutingTable is the client for interacting with the IPStaticRoutingTable builders.
	IPStaticRoutingTable *IPStaticRoutingTableClient
	// NetInterface is the client for interacting with the NetInterface builders.
	NetInterface *NetInterfaceClient
	// NetInterfaceLayer is the client for interacting with the NetInterfaceLayer builders.
	NetInterfaceLayer *NetInterfaceLayerClient
	// NetInterfaceMode is the client for interacting with the NetInterfaceMode builders.
	NetInterfaceMode *NetInterfaceModeClient
	// NetTopology is the client for interacting with the NetTopology builders.
	NetTopology *NetTopologyClient
	// NetTopologyDeviceMap is the client for interacting with the NetTopologyDeviceMap builders.
	NetTopologyDeviceMap *NetTopologyDeviceMapClient
	// PortChannelInterface is the client for interacting with the PortChannelInterface builders.
	PortChannelInterface *PortChannelInterfaceClient
	// Vlan is the client for interacting with the Vlan builders.
	Vlan *VlanClient
	// 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 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 Vlan

type Vlan struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// VlanID holds the value of the "vlan_id" field.
	VlanID int `json:"vlan_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the VlanQuery when eager-loading is set.
	Edges VlanEdges `json:"edges"`
	// contains filtered or unexported fields
}

Vlan is the model entity for the Vlan schema.

func (*Vlan) QueryNativeVlan

func (v *Vlan) QueryNativeVlan() *NetInterfaceQuery

QueryNativeVlan queries the "native_vlan" edge of the Vlan entity.

func (*Vlan) QueryOnDevice

func (v *Vlan) QueryOnDevice() *DeviceQuery

QueryOnDevice queries the "on_device" edge of the Vlan entity.

func (*Vlan) QueryPoNativeVlan added in v0.2.0

func (v *Vlan) QueryPoNativeVlan() *PortChannelInterfaceQuery

QueryPoNativeVlan queries the "po_native_vlan" edge of the Vlan entity.

func (*Vlan) QueryPoVlans added in v0.2.0

func (v *Vlan) QueryPoVlans() *PortChannelInterfaceQuery

QueryPoVlans queries the "po_vlans" edge of the Vlan entity.

func (*Vlan) QueryVlans

func (v *Vlan) QueryVlans() *NetInterfaceQuery

QueryVlans queries the "vlans" edge of the Vlan entity.

func (*Vlan) String

func (v *Vlan) String() string

String implements the fmt.Stringer.

func (*Vlan) Unwrap

func (v *Vlan) Unwrap() *Vlan

Unwrap unwraps the Vlan 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 (*Vlan) Update

func (v *Vlan) Update() *VlanUpdateOne

Update returns a builder for updating this Vlan. Note that you need to call Vlan.Unwrap() before calling this method if this Vlan was returned from a transaction, and the transaction was committed or rolled back.

type VlanClient

type VlanClient struct {
	// contains filtered or unexported fields
}

VlanClient is a client for the Vlan schema.

func NewVlanClient

func NewVlanClient(c config) *VlanClient

NewVlanClient returns a client for the Vlan from the given config.

func (*VlanClient) Create

func (c *VlanClient) Create() *VlanCreate

Create returns a create builder for Vlan.

func (*VlanClient) CreateBulk

func (c *VlanClient) CreateBulk(builders ...*VlanCreate) *VlanCreateBulk

CreateBulk returns a builder for creating a bulk of Vlan entities.

func (*VlanClient) Delete

func (c *VlanClient) Delete() *VlanDelete

Delete returns a delete builder for Vlan.

func (*VlanClient) DeleteOne

func (c *VlanClient) DeleteOne(v *Vlan) *VlanDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*VlanClient) DeleteOneID

func (c *VlanClient) DeleteOneID(id int) *VlanDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*VlanClient) Get

func (c *VlanClient) Get(ctx context.Context, id int) (*Vlan, error)

Get returns a Vlan entity by its id.

func (*VlanClient) GetX

func (c *VlanClient) GetX(ctx context.Context, id int) *Vlan

GetX is like Get, but panics if an error occurs.

func (*VlanClient) Hooks

func (c *VlanClient) Hooks() []Hook

Hooks returns the client hooks.

func (*VlanClient) Query

func (c *VlanClient) Query() *VlanQuery

Query returns a query builder for Vlan.

func (*VlanClient) QueryNativeVlan

func (c *VlanClient) QueryNativeVlan(v *Vlan) *NetInterfaceQuery

QueryNativeVlan queries the native_vlan edge of a Vlan.

func (*VlanClient) QueryOnDevice

func (c *VlanClient) QueryOnDevice(v *Vlan) *DeviceQuery

QueryOnDevice queries the on_device edge of a Vlan.

func (*VlanClient) QueryPoNativeVlan added in v0.2.0

func (c *VlanClient) QueryPoNativeVlan(v *Vlan) *PortChannelInterfaceQuery

QueryPoNativeVlan queries the po_native_vlan edge of a Vlan.

func (*VlanClient) QueryPoVlans added in v0.2.0

func (c *VlanClient) QueryPoVlans(v *Vlan) *PortChannelInterfaceQuery

QueryPoVlans queries the po_vlans edge of a Vlan.

func (*VlanClient) QueryVlans

func (c *VlanClient) QueryVlans(v *Vlan) *NetInterfaceQuery

QueryVlans queries the vlans edge of a Vlan.

func (*VlanClient) Update

func (c *VlanClient) Update() *VlanUpdate

Update returns an update builder for Vlan.

func (*VlanClient) UpdateOne

func (c *VlanClient) UpdateOne(v *Vlan) *VlanUpdateOne

UpdateOne returns an update builder for the given entity.

func (*VlanClient) UpdateOneID

func (c *VlanClient) UpdateOneID(id int) *VlanUpdateOne

UpdateOneID returns an update builder for the given id.

func (*VlanClient) Use

func (c *VlanClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `vlan.Hooks(f(g(h())))`.

type VlanCreate

type VlanCreate struct {
	// contains filtered or unexported fields
}

VlanCreate is the builder for creating a Vlan entity.

func (*VlanCreate) AddNativeVlan

func (vc *VlanCreate) AddNativeVlan(n ...*NetInterface) *VlanCreate

AddNativeVlan adds the "native_vlan" edges to the NetInterface entity.

func (*VlanCreate) AddNativeVlanIDs

func (vc *VlanCreate) AddNativeVlanIDs(ids ...int) *VlanCreate

AddNativeVlanIDs adds the "native_vlan" edge to the NetInterface entity by IDs.

func (*VlanCreate) AddOnDevice

func (vc *VlanCreate) AddOnDevice(d ...*Device) *VlanCreate

AddOnDevice adds the "on_device" edges to the Device entity.

func (*VlanCreate) AddOnDeviceIDs

func (vc *VlanCreate) AddOnDeviceIDs(ids ...int) *VlanCreate

AddOnDeviceIDs adds the "on_device" edge to the Device entity by IDs.

func (*VlanCreate) AddPoNativeVlan added in v0.2.0

func (vc *VlanCreate) AddPoNativeVlan(p ...*PortChannelInterface) *VlanCreate

AddPoNativeVlan adds the "po_native_vlan" edges to the PortChannelInterface entity.

func (*VlanCreate) AddPoNativeVlanIDs added in v0.2.0

func (vc *VlanCreate) AddPoNativeVlanIDs(ids ...int) *VlanCreate

AddPoNativeVlanIDs adds the "po_native_vlan" edge to the PortChannelInterface entity by IDs.

func (*VlanCreate) AddPoVlanIDs added in v0.2.0

func (vc *VlanCreate) AddPoVlanIDs(ids ...int) *VlanCreate

AddPoVlanIDs adds the "po_vlans" edge to the PortChannelInterface entity by IDs.

func (*VlanCreate) AddPoVlans added in v0.2.0

func (vc *VlanCreate) AddPoVlans(p ...*PortChannelInterface) *VlanCreate

AddPoVlans adds the "po_vlans" edges to the PortChannelInterface entity.

func (*VlanCreate) AddVlanIDs

func (vc *VlanCreate) AddVlanIDs(ids ...int) *VlanCreate

AddVlanIDs adds the "vlans" edge to the NetInterface entity by IDs.

func (*VlanCreate) AddVlans

func (vc *VlanCreate) AddVlans(n ...*NetInterface) *VlanCreate

AddVlans adds the "vlans" edges to the NetInterface entity.

func (*VlanCreate) Mutation

func (vc *VlanCreate) Mutation() *VlanMutation

Mutation returns the VlanMutation object of the builder.

func (*VlanCreate) Save

func (vc *VlanCreate) Save(ctx context.Context) (*Vlan, error)

Save creates the Vlan in the database.

func (*VlanCreate) SaveX

func (vc *VlanCreate) SaveX(ctx context.Context) *Vlan

SaveX calls Save and panics if Save returns an error.

func (*VlanCreate) SetVlanID

func (vc *VlanCreate) SetVlanID(i int) *VlanCreate

SetVlanID sets the "vlan_id" field.

type VlanCreateBulk

type VlanCreateBulk struct {
	// contains filtered or unexported fields
}

VlanCreateBulk is the builder for creating many Vlan entities in bulk.

func (*VlanCreateBulk) Save

func (vcb *VlanCreateBulk) Save(ctx context.Context) ([]*Vlan, error)

Save creates the Vlan entities in the database.

func (*VlanCreateBulk) SaveX

func (vcb *VlanCreateBulk) SaveX(ctx context.Context) []*Vlan

SaveX is like Save, but panics if an error occurs.

type VlanDelete

type VlanDelete struct {
	// contains filtered or unexported fields
}

VlanDelete is the builder for deleting a Vlan entity.

func (*VlanDelete) Exec

func (vd *VlanDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*VlanDelete) ExecX

func (vd *VlanDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*VlanDelete) Where

func (vd *VlanDelete) Where(ps ...predicate.Vlan) *VlanDelete

Where adds a new predicate to the VlanDelete builder.

type VlanDeleteOne

type VlanDeleteOne struct {
	// contains filtered or unexported fields
}

VlanDeleteOne is the builder for deleting a single Vlan entity.

func (*VlanDeleteOne) Exec

func (vdo *VlanDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*VlanDeleteOne) ExecX

func (vdo *VlanDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type VlanEdges

type VlanEdges struct {
	// Vlans holds the value of the vlans edge.
	Vlans []*NetInterface `json:"vlans,omitempty"`
	// NativeVlan holds the value of the native_vlan edge.
	NativeVlan []*NetInterface `json:"native_vlan,omitempty"`
	// PoVlans holds the value of the po_vlans edge.
	PoVlans []*PortChannelInterface `json:"po_vlans,omitempty"`
	// PoNativeVlan holds the value of the po_native_vlan edge.
	PoNativeVlan []*PortChannelInterface `json:"po_native_vlan,omitempty"`
	// OnDevice holds the value of the on_device edge.
	OnDevice []*Device `json:"on_device,omitempty"`
	// contains filtered or unexported fields
}

VlanEdges holds the relations/edges for other nodes in the graph.

func (VlanEdges) NativeVlanOrErr

func (e VlanEdges) NativeVlanOrErr() ([]*NetInterface, error)

NativeVlanOrErr returns the NativeVlan value or an error if the edge was not loaded in eager-loading.

func (VlanEdges) OnDeviceOrErr

func (e VlanEdges) OnDeviceOrErr() ([]*Device, error)

OnDeviceOrErr returns the OnDevice value or an error if the edge was not loaded in eager-loading.

func (VlanEdges) PoNativeVlanOrErr added in v0.2.0

func (e VlanEdges) PoNativeVlanOrErr() ([]*PortChannelInterface, error)

PoNativeVlanOrErr returns the PoNativeVlan value or an error if the edge was not loaded in eager-loading.

func (VlanEdges) PoVlansOrErr added in v0.2.0

func (e VlanEdges) PoVlansOrErr() ([]*PortChannelInterface, error)

PoVlansOrErr returns the PoVlans value or an error if the edge was not loaded in eager-loading.

func (VlanEdges) VlansOrErr

func (e VlanEdges) VlansOrErr() ([]*NetInterface, error)

VlansOrErr returns the Vlans value or an error if the edge was not loaded in eager-loading.

type VlanGroupBy

type VlanGroupBy struct {
	// contains filtered or unexported fields
}

VlanGroupBy is the group-by builder for Vlan entities.

func (*VlanGroupBy) Aggregate

func (vgb *VlanGroupBy) Aggregate(fns ...AggregateFunc) *VlanGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*VlanGroupBy) Bool

func (vgb *VlanGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*VlanGroupBy) BoolX

func (vgb *VlanGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*VlanGroupBy) Bools

func (vgb *VlanGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*VlanGroupBy) BoolsX

func (vgb *VlanGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*VlanGroupBy) Float64

func (vgb *VlanGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*VlanGroupBy) Float64X

func (vgb *VlanGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*VlanGroupBy) Float64s

func (vgb *VlanGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*VlanGroupBy) Float64sX

func (vgb *VlanGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*VlanGroupBy) Int

func (vgb *VlanGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*VlanGroupBy) IntX

func (vgb *VlanGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*VlanGroupBy) Ints

func (vgb *VlanGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*VlanGroupBy) IntsX

func (vgb *VlanGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*VlanGroupBy) Scan

func (vgb *VlanGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*VlanGroupBy) ScanX

func (vgb *VlanGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*VlanGroupBy) String

func (vgb *VlanGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*VlanGroupBy) StringX

func (vgb *VlanGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*VlanGroupBy) Strings

func (vgb *VlanGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*VlanGroupBy) StringsX

func (vgb *VlanGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type VlanMutation

type VlanMutation struct {
	// contains filtered or unexported fields
}

VlanMutation represents an operation that mutates the Vlan nodes in the graph.

func (*VlanMutation) AddField

func (m *VlanMutation) 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 (*VlanMutation) AddNativeVlanIDs

func (m *VlanMutation) AddNativeVlanIDs(ids ...int)

AddNativeVlanIDs adds the "native_vlan" edge to the NetInterface entity by ids.

func (*VlanMutation) AddOnDeviceIDs

func (m *VlanMutation) AddOnDeviceIDs(ids ...int)

AddOnDeviceIDs adds the "on_device" edge to the Device entity by ids.

func (*VlanMutation) AddPoNativeVlanIDs added in v0.2.0

func (m *VlanMutation) AddPoNativeVlanIDs(ids ...int)

AddPoNativeVlanIDs adds the "po_native_vlan" edge to the PortChannelInterface entity by ids.

func (*VlanMutation) AddPoVlanIDs added in v0.2.0

func (m *VlanMutation) AddPoVlanIDs(ids ...int)

AddPoVlanIDs adds the "po_vlans" edge to the PortChannelInterface entity by ids.

func (*VlanMutation) AddVlanID

func (m *VlanMutation) AddVlanID(i int)

AddVlanID adds i to the "vlan_id" field.

func (*VlanMutation) AddVlanIDs

func (m *VlanMutation) AddVlanIDs(ids ...int)

AddVlanIDs adds the "vlans" edge to the NetInterface entity by ids.

func (*VlanMutation) AddedEdges

func (m *VlanMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*VlanMutation) AddedField

func (m *VlanMutation) 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 (*VlanMutation) AddedFields

func (m *VlanMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*VlanMutation) AddedIDs

func (m *VlanMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*VlanMutation) AddedVlanID

func (m *VlanMutation) AddedVlanID() (r int, exists bool)

AddedVlanID returns the value that was added to the "vlan_id" field in this mutation.

func (*VlanMutation) ClearEdge

func (m *VlanMutation) 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 (*VlanMutation) ClearField

func (m *VlanMutation) 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 (*VlanMutation) ClearNativeVlan

func (m *VlanMutation) ClearNativeVlan()

ClearNativeVlan clears the "native_vlan" edge to the NetInterface entity.

func (*VlanMutation) ClearOnDevice

func (m *VlanMutation) ClearOnDevice()

ClearOnDevice clears the "on_device" edge to the Device entity.

func (*VlanMutation) ClearPoNativeVlan added in v0.2.0

func (m *VlanMutation) ClearPoNativeVlan()

ClearPoNativeVlan clears the "po_native_vlan" edge to the PortChannelInterface entity.

func (*VlanMutation) ClearPoVlans added in v0.2.0

func (m *VlanMutation) ClearPoVlans()

ClearPoVlans clears the "po_vlans" edge to the PortChannelInterface entity.

func (*VlanMutation) ClearVlans

func (m *VlanMutation) ClearVlans()

ClearVlans clears the "vlans" edge to the NetInterface entity.

func (*VlanMutation) ClearedEdges

func (m *VlanMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*VlanMutation) ClearedFields

func (m *VlanMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (VlanMutation) Client

func (m VlanMutation) 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 (*VlanMutation) EdgeCleared

func (m *VlanMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*VlanMutation) Field

func (m *VlanMutation) 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 (*VlanMutation) FieldCleared

func (m *VlanMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*VlanMutation) Fields

func (m *VlanMutation) 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 (*VlanMutation) ID

func (m *VlanMutation) 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.

func (*VlanMutation) NativeVlanCleared

func (m *VlanMutation) NativeVlanCleared() bool

NativeVlanCleared reports if the "native_vlan" edge to the NetInterface entity was cleared.

func (*VlanMutation) NativeVlanIDs

func (m *VlanMutation) NativeVlanIDs() (ids []int)

NativeVlanIDs returns the "native_vlan" edge IDs in the mutation.

func (*VlanMutation) OldField

func (m *VlanMutation) 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 (*VlanMutation) OldVlanID

func (m *VlanMutation) OldVlanID(ctx context.Context) (v int, err error)

OldVlanID returns the old "vlan_id" field's value of the Vlan entity. If the Vlan 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 (*VlanMutation) OnDeviceCleared

func (m *VlanMutation) OnDeviceCleared() bool

OnDeviceCleared reports if the "on_device" edge to the Device entity was cleared.

func (*VlanMutation) OnDeviceIDs

func (m *VlanMutation) OnDeviceIDs() (ids []int)

OnDeviceIDs returns the "on_device" edge IDs in the mutation.

func (*VlanMutation) Op

func (m *VlanMutation) Op() Op

Op returns the operation name.

func (*VlanMutation) PoNativeVlanCleared added in v0.2.0

func (m *VlanMutation) PoNativeVlanCleared() bool

PoNativeVlanCleared reports if the "po_native_vlan" edge to the PortChannelInterface entity was cleared.

func (*VlanMutation) PoNativeVlanIDs added in v0.2.0

func (m *VlanMutation) PoNativeVlanIDs() (ids []int)

PoNativeVlanIDs returns the "po_native_vlan" edge IDs in the mutation.

func (*VlanMutation) PoVlansCleared added in v0.2.0

func (m *VlanMutation) PoVlansCleared() bool

PoVlansCleared reports if the "po_vlans" edge to the PortChannelInterface entity was cleared.

func (*VlanMutation) PoVlansIDs added in v0.2.0

func (m *VlanMutation) PoVlansIDs() (ids []int)

PoVlansIDs returns the "po_vlans" edge IDs in the mutation.

func (*VlanMutation) RemoveNativeVlanIDs

func (m *VlanMutation) RemoveNativeVlanIDs(ids ...int)

RemoveNativeVlanIDs removes the "native_vlan" edge to the NetInterface entity by IDs.

func (*VlanMutation) RemoveOnDeviceIDs

func (m *VlanMutation) RemoveOnDeviceIDs(ids ...int)

RemoveOnDeviceIDs removes the "on_device" edge to the Device entity by IDs.

func (*VlanMutation) RemovePoNativeVlanIDs added in v0.2.0

func (m *VlanMutation) RemovePoNativeVlanIDs(ids ...int)

RemovePoNativeVlanIDs removes the "po_native_vlan" edge to the PortChannelInterface entity by IDs.

func (*VlanMutation) RemovePoVlanIDs added in v0.2.0

func (m *VlanMutation) RemovePoVlanIDs(ids ...int)

RemovePoVlanIDs removes the "po_vlans" edge to the PortChannelInterface entity by IDs.

func (*VlanMutation) RemoveVlanIDs

func (m *VlanMutation) RemoveVlanIDs(ids ...int)

RemoveVlanIDs removes the "vlans" edge to the NetInterface entity by IDs.

func (*VlanMutation) RemovedEdges

func (m *VlanMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*VlanMutation) RemovedIDs

func (m *VlanMutation) 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 (*VlanMutation) RemovedNativeVlanIDs

func (m *VlanMutation) RemovedNativeVlanIDs() (ids []int)

RemovedNativeVlan returns the removed IDs of the "native_vlan" edge to the NetInterface entity.

func (*VlanMutation) RemovedOnDeviceIDs

func (m *VlanMutation) RemovedOnDeviceIDs() (ids []int)

RemovedOnDevice returns the removed IDs of the "on_device" edge to the Device entity.

func (*VlanMutation) RemovedPoNativeVlanIDs added in v0.2.0

func (m *VlanMutation) RemovedPoNativeVlanIDs() (ids []int)

RemovedPoNativeVlan returns the removed IDs of the "po_native_vlan" edge to the PortChannelInterface entity.

func (*VlanMutation) RemovedPoVlansIDs added in v0.2.0

func (m *VlanMutation) RemovedPoVlansIDs() (ids []int)

RemovedPoVlans returns the removed IDs of the "po_vlans" edge to the PortChannelInterface entity.

func (*VlanMutation) RemovedVlansIDs

func (m *VlanMutation) RemovedVlansIDs() (ids []int)

RemovedVlans returns the removed IDs of the "vlans" edge to the NetInterface entity.

func (*VlanMutation) ResetEdge

func (m *VlanMutation) 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 (*VlanMutation) ResetField

func (m *VlanMutation) 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 (*VlanMutation) ResetNativeVlan

func (m *VlanMutation) ResetNativeVlan()

ResetNativeVlan resets all changes to the "native_vlan" edge.

func (*VlanMutation) ResetOnDevice

func (m *VlanMutation) ResetOnDevice()

ResetOnDevice resets all changes to the "on_device" edge.

func (*VlanMutation) ResetPoNativeVlan added in v0.2.0

func (m *VlanMutation) ResetPoNativeVlan()

ResetPoNativeVlan resets all changes to the "po_native_vlan" edge.

func (*VlanMutation) ResetPoVlans added in v0.2.0

func (m *VlanMutation) ResetPoVlans()

ResetPoVlans resets all changes to the "po_vlans" edge.

func (*VlanMutation) ResetVlanID

func (m *VlanMutation) ResetVlanID()

ResetVlanID resets all changes to the "vlan_id" field.

func (*VlanMutation) ResetVlans

func (m *VlanMutation) ResetVlans()

ResetVlans resets all changes to the "vlans" edge.

func (*VlanMutation) SetField

func (m *VlanMutation) 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 (*VlanMutation) SetVlanID

func (m *VlanMutation) SetVlanID(i int)

SetVlanID sets the "vlan_id" field.

func (VlanMutation) Tx

func (m VlanMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*VlanMutation) Type

func (m *VlanMutation) Type() string

Type returns the node type of this mutation (Vlan).

func (*VlanMutation) VlanID

func (m *VlanMutation) VlanID() (r int, exists bool)

VlanID returns the value of the "vlan_id" field in the mutation.

func (*VlanMutation) VlansCleared

func (m *VlanMutation) VlansCleared() bool

VlansCleared reports if the "vlans" edge to the NetInterface entity was cleared.

func (*VlanMutation) VlansIDs

func (m *VlanMutation) VlansIDs() (ids []int)

VlansIDs returns the "vlans" edge IDs in the mutation.

type VlanQuery

type VlanQuery struct {
	// contains filtered or unexported fields
}

VlanQuery is the builder for querying Vlan entities.

func (*VlanQuery) All

func (vq *VlanQuery) All(ctx context.Context) ([]*Vlan, error)

All executes the query and returns a list of Vlans.

func (*VlanQuery) AllX

func (vq *VlanQuery) AllX(ctx context.Context) []*Vlan

AllX is like All, but panics if an error occurs.

func (*VlanQuery) Clone

func (vq *VlanQuery) Clone() *VlanQuery

Clone returns a duplicate of the VlanQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*VlanQuery) Count

func (vq *VlanQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*VlanQuery) CountX

func (vq *VlanQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*VlanQuery) Exist

func (vq *VlanQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*VlanQuery) ExistX

func (vq *VlanQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*VlanQuery) First

func (vq *VlanQuery) First(ctx context.Context) (*Vlan, error)

First returns the first Vlan entity from the query. Returns a *NotFoundError when no Vlan was found.

func (*VlanQuery) FirstID

func (vq *VlanQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Vlan ID from the query. Returns a *NotFoundError when no Vlan ID was found.

func (*VlanQuery) FirstIDX

func (vq *VlanQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*VlanQuery) FirstX

func (vq *VlanQuery) FirstX(ctx context.Context) *Vlan

FirstX is like First, but panics if an error occurs.

func (*VlanQuery) GroupBy

func (vq *VlanQuery) GroupBy(field string, fields ...string) *VlanGroupBy

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 {
	VlanID int `json:"vlan_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Vlan.Query().
	GroupBy(vlan.FieldVlanID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*VlanQuery) IDs

func (vq *VlanQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of Vlan IDs.

func (*VlanQuery) IDsX

func (vq *VlanQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*VlanQuery) Limit

func (vq *VlanQuery) Limit(limit int) *VlanQuery

Limit adds a limit step to the query.

func (*VlanQuery) Offset

func (vq *VlanQuery) Offset(offset int) *VlanQuery

Offset adds an offset step to the query.

func (*VlanQuery) Only

func (vq *VlanQuery) Only(ctx context.Context) (*Vlan, error)

Only returns a single Vlan entity found by the query, ensuring it only returns one. Returns a *NotSingularError when exactly one Vlan entity is not found. Returns a *NotFoundError when no Vlan entities are found.

func (*VlanQuery) OnlyID

func (vq *VlanQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Vlan ID in the query. Returns a *NotSingularError when exactly one Vlan ID is not found. Returns a *NotFoundError when no entities are found.

func (*VlanQuery) OnlyIDX

func (vq *VlanQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*VlanQuery) OnlyX

func (vq *VlanQuery) OnlyX(ctx context.Context) *Vlan

OnlyX is like Only, but panics if an error occurs.

func (*VlanQuery) Order

func (vq *VlanQuery) Order(o ...OrderFunc) *VlanQuery

Order adds an order step to the query.

func (*VlanQuery) QueryNativeVlan

func (vq *VlanQuery) QueryNativeVlan() *NetInterfaceQuery

QueryNativeVlan chains the current query on the "native_vlan" edge.

func (*VlanQuery) QueryOnDevice

func (vq *VlanQuery) QueryOnDevice() *DeviceQuery

QueryOnDevice chains the current query on the "on_device" edge.

func (*VlanQuery) QueryPoNativeVlan added in v0.2.0

func (vq *VlanQuery) QueryPoNativeVlan() *PortChannelInterfaceQuery

QueryPoNativeVlan chains the current query on the "po_native_vlan" edge.

func (*VlanQuery) QueryPoVlans added in v0.2.0

func (vq *VlanQuery) QueryPoVlans() *PortChannelInterfaceQuery

QueryPoVlans chains the current query on the "po_vlans" edge.

func (*VlanQuery) QueryVlans

func (vq *VlanQuery) QueryVlans() *NetInterfaceQuery

QueryVlans chains the current query on the "vlans" edge.

func (*VlanQuery) Select

func (vq *VlanQuery) Select(field string, fields ...string) *VlanSelect

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 {
	VlanID int `json:"vlan_id,omitempty"`
}

client.Vlan.Query().
	Select(vlan.FieldVlanID).
	Scan(ctx, &v)

func (*VlanQuery) Unique

func (vq *VlanQuery) Unique(unique bool) *VlanQuery

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 (*VlanQuery) Where

func (vq *VlanQuery) Where(ps ...predicate.Vlan) *VlanQuery

Where adds a new predicate for the VlanQuery builder.

func (*VlanQuery) WithNativeVlan

func (vq *VlanQuery) WithNativeVlan(opts ...func(*NetInterfaceQuery)) *VlanQuery

WithNativeVlan tells the query-builder to eager-load the nodes that are connected to the "native_vlan" edge. The optional arguments are used to configure the query builder of the edge.

func (*VlanQuery) WithOnDevice

func (vq *VlanQuery) WithOnDevice(opts ...func(*DeviceQuery)) *VlanQuery

WithOnDevice tells the query-builder to eager-load the nodes that are connected to the "on_device" edge. The optional arguments are used to configure the query builder of the edge.

func (*VlanQuery) WithPoNativeVlan added in v0.2.0

func (vq *VlanQuery) WithPoNativeVlan(opts ...func(*PortChannelInterfaceQuery)) *VlanQuery

WithPoNativeVlan tells the query-builder to eager-load the nodes that are connected to the "po_native_vlan" edge. The optional arguments are used to configure the query builder of the edge.

func (*VlanQuery) WithPoVlans added in v0.2.0

func (vq *VlanQuery) WithPoVlans(opts ...func(*PortChannelInterfaceQuery)) *VlanQuery

WithPoVlans tells the query-builder to eager-load the nodes that are connected to the "po_vlans" edge. The optional arguments are used to configure the query builder of the edge.

func (*VlanQuery) WithVlans

func (vq *VlanQuery) WithVlans(opts ...func(*NetInterfaceQuery)) *VlanQuery

WithVlans tells the query-builder to eager-load the nodes that are connected to the "vlans" edge. The optional arguments are used to configure the query builder of the edge.

type VlanSelect

type VlanSelect struct {
	*VlanQuery
	// contains filtered or unexported fields
}

VlanSelect is the builder for selecting fields of Vlan entities.

func (*VlanSelect) Bool

func (vs *VlanSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*VlanSelect) BoolX

func (vs *VlanSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*VlanSelect) Bools

func (vs *VlanSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*VlanSelect) BoolsX

func (vs *VlanSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*VlanSelect) Float64

func (vs *VlanSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*VlanSelect) Float64X

func (vs *VlanSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*VlanSelect) Float64s

func (vs *VlanSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*VlanSelect) Float64sX

func (vs *VlanSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*VlanSelect) Int

func (vs *VlanSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*VlanSelect) IntX

func (vs *VlanSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*VlanSelect) Ints

func (vs *VlanSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*VlanSelect) IntsX

func (vs *VlanSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*VlanSelect) Scan

func (vs *VlanSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*VlanSelect) ScanX

func (vs *VlanSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*VlanSelect) String

func (vs *VlanSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*VlanSelect) StringX

func (vs *VlanSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*VlanSelect) Strings

func (vs *VlanSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*VlanSelect) StringsX

func (vs *VlanSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type VlanUpdate

type VlanUpdate struct {
	// contains filtered or unexported fields
}

VlanUpdate is the builder for updating Vlan entities.

func (*VlanUpdate) AddNativeVlan

func (vu *VlanUpdate) AddNativeVlan(n ...*NetInterface) *VlanUpdate

AddNativeVlan adds the "native_vlan" edges to the NetInterface entity.

func (*VlanUpdate) AddNativeVlanIDs

func (vu *VlanUpdate) AddNativeVlanIDs(ids ...int) *VlanUpdate

AddNativeVlanIDs adds the "native_vlan" edge to the NetInterface entity by IDs.

func (*VlanUpdate) AddOnDevice

func (vu *VlanUpdate) AddOnDevice(d ...*Device) *VlanUpdate

AddOnDevice adds the "on_device" edges to the Device entity.

func (*VlanUpdate) AddOnDeviceIDs

func (vu *VlanUpdate) AddOnDeviceIDs(ids ...int) *VlanUpdate

AddOnDeviceIDs adds the "on_device" edge to the Device entity by IDs.

func (*VlanUpdate) AddPoNativeVlan added in v0.2.0

func (vu *VlanUpdate) AddPoNativeVlan(p ...*PortChannelInterface) *VlanUpdate

AddPoNativeVlan adds the "po_native_vlan" edges to the PortChannelInterface entity.

func (*VlanUpdate) AddPoNativeVlanIDs added in v0.2.0

func (vu *VlanUpdate) AddPoNativeVlanIDs(ids ...int) *VlanUpdate

AddPoNativeVlanIDs adds the "po_native_vlan" edge to the PortChannelInterface entity by IDs.

func (*VlanUpdate) AddPoVlanIDs added in v0.2.0

func (vu *VlanUpdate) AddPoVlanIDs(ids ...int) *VlanUpdate

AddPoVlanIDs adds the "po_vlans" edge to the PortChannelInterface entity by IDs.

func (*VlanUpdate) AddPoVlans added in v0.2.0

func (vu *VlanUpdate) AddPoVlans(p ...*PortChannelInterface) *VlanUpdate

AddPoVlans adds the "po_vlans" edges to the PortChannelInterface entity.

func (*VlanUpdate) AddVlanID

func (vu *VlanUpdate) AddVlanID(i int) *VlanUpdate

AddVlanID adds i to the "vlan_id" field.

func (*VlanUpdate) AddVlanIDs

func (vu *VlanUpdate) AddVlanIDs(ids ...int) *VlanUpdate

AddVlanIDs adds the "vlans" edge to the NetInterface entity by IDs.

func (*VlanUpdate) AddVlans

func (vu *VlanUpdate) AddVlans(n ...*NetInterface) *VlanUpdate

AddVlans adds the "vlans" edges to the NetInterface entity.

func (*VlanUpdate) ClearNativeVlan

func (vu *VlanUpdate) ClearNativeVlan() *VlanUpdate

ClearNativeVlan clears all "native_vlan" edges to the NetInterface entity.

func (*VlanUpdate) ClearOnDevice

func (vu *VlanUpdate) ClearOnDevice() *VlanUpdate

ClearOnDevice clears all "on_device" edges to the Device entity.

func (*VlanUpdate) ClearPoNativeVlan added in v0.2.0

func (vu *VlanUpdate) ClearPoNativeVlan() *VlanUpdate

ClearPoNativeVlan clears all "po_native_vlan" edges to the PortChannelInterface entity.

func (*VlanUpdate) ClearPoVlans added in v0.2.0

func (vu *VlanUpdate) ClearPoVlans() *VlanUpdate

ClearPoVlans clears all "po_vlans" edges to the PortChannelInterface entity.

func (*VlanUpdate) ClearVlans

func (vu *VlanUpdate) ClearVlans() *VlanUpdate

ClearVlans clears all "vlans" edges to the NetInterface entity.

func (*VlanUpdate) Exec

func (vu *VlanUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*VlanUpdate) ExecX

func (vu *VlanUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*VlanUpdate) Mutation

func (vu *VlanUpdate) Mutation() *VlanMutation

Mutation returns the VlanMutation object of the builder.

func (*VlanUpdate) RemoveNativeVlan

func (vu *VlanUpdate) RemoveNativeVlan(n ...*NetInterface) *VlanUpdate

RemoveNativeVlan removes "native_vlan" edges to NetInterface entities.

func (*VlanUpdate) RemoveNativeVlanIDs

func (vu *VlanUpdate) RemoveNativeVlanIDs(ids ...int) *VlanUpdate

RemoveNativeVlanIDs removes the "native_vlan" edge to NetInterface entities by IDs.

func (*VlanUpdate) RemoveOnDevice

func (vu *VlanUpdate) RemoveOnDevice(d ...*Device) *VlanUpdate

RemoveOnDevice removes "on_device" edges to Device entities.

func (*VlanUpdate) RemoveOnDeviceIDs

func (vu *VlanUpdate) RemoveOnDeviceIDs(ids ...int) *VlanUpdate

RemoveOnDeviceIDs removes the "on_device" edge to Device entities by IDs.

func (*VlanUpdate) RemovePoNativeVlan added in v0.2.0

func (vu *VlanUpdate) RemovePoNativeVlan(p ...*PortChannelInterface) *VlanUpdate

RemovePoNativeVlan removes "po_native_vlan" edges to PortChannelInterface entities.

func (*VlanUpdate) RemovePoNativeVlanIDs added in v0.2.0

func (vu *VlanUpdate) RemovePoNativeVlanIDs(ids ...int) *VlanUpdate

RemovePoNativeVlanIDs removes the "po_native_vlan" edge to PortChannelInterface entities by IDs.

func (*VlanUpdate) RemovePoVlanIDs added in v0.2.0

func (vu *VlanUpdate) RemovePoVlanIDs(ids ...int) *VlanUpdate

RemovePoVlanIDs removes the "po_vlans" edge to PortChannelInterface entities by IDs.

func (*VlanUpdate) RemovePoVlans added in v0.2.0

func (vu *VlanUpdate) RemovePoVlans(p ...*PortChannelInterface) *VlanUpdate

RemovePoVlans removes "po_vlans" edges to PortChannelInterface entities.

func (*VlanUpdate) RemoveVlanIDs

func (vu *VlanUpdate) RemoveVlanIDs(ids ...int) *VlanUpdate

RemoveVlanIDs removes the "vlans" edge to NetInterface entities by IDs.

func (*VlanUpdate) RemoveVlans

func (vu *VlanUpdate) RemoveVlans(n ...*NetInterface) *VlanUpdate

RemoveVlans removes "vlans" edges to NetInterface entities.

func (*VlanUpdate) Save

func (vu *VlanUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*VlanUpdate) SaveX

func (vu *VlanUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*VlanUpdate) SetVlanID

func (vu *VlanUpdate) SetVlanID(i int) *VlanUpdate

SetVlanID sets the "vlan_id" field.

func (*VlanUpdate) Where

func (vu *VlanUpdate) Where(ps ...predicate.Vlan) *VlanUpdate

Where adds a new predicate for the VlanUpdate builder.

type VlanUpdateOne

type VlanUpdateOne struct {
	// contains filtered or unexported fields
}

VlanUpdateOne is the builder for updating a single Vlan entity.

func (*VlanUpdateOne) AddNativeVlan

func (vuo *VlanUpdateOne) AddNativeVlan(n ...*NetInterface) *VlanUpdateOne

AddNativeVlan adds the "native_vlan" edges to the NetInterface entity.

func (*VlanUpdateOne) AddNativeVlanIDs

func (vuo *VlanUpdateOne) AddNativeVlanIDs(ids ...int) *VlanUpdateOne

AddNativeVlanIDs adds the "native_vlan" edge to the NetInterface entity by IDs.

func (*VlanUpdateOne) AddOnDevice

func (vuo *VlanUpdateOne) AddOnDevice(d ...*Device) *VlanUpdateOne

AddOnDevice adds the "on_device" edges to the Device entity.

func (*VlanUpdateOne) AddOnDeviceIDs

func (vuo *VlanUpdateOne) AddOnDeviceIDs(ids ...int) *VlanUpdateOne

AddOnDeviceIDs adds the "on_device" edge to the Device entity by IDs.

func (*VlanUpdateOne) AddPoNativeVlan added in v0.2.0

func (vuo *VlanUpdateOne) AddPoNativeVlan(p ...*PortChannelInterface) *VlanUpdateOne

AddPoNativeVlan adds the "po_native_vlan" edges to the PortChannelInterface entity.

func (*VlanUpdateOne) AddPoNativeVlanIDs added in v0.2.0

func (vuo *VlanUpdateOne) AddPoNativeVlanIDs(ids ...int) *VlanUpdateOne

AddPoNativeVlanIDs adds the "po_native_vlan" edge to the PortChannelInterface entity by IDs.

func (*VlanUpdateOne) AddPoVlanIDs added in v0.2.0

func (vuo *VlanUpdateOne) AddPoVlanIDs(ids ...int) *VlanUpdateOne

AddPoVlanIDs adds the "po_vlans" edge to the PortChannelInterface entity by IDs.

func (*VlanUpdateOne) AddPoVlans added in v0.2.0

func (vuo *VlanUpdateOne) AddPoVlans(p ...*PortChannelInterface) *VlanUpdateOne

AddPoVlans adds the "po_vlans" edges to the PortChannelInterface entity.

func (*VlanUpdateOne) AddVlanID

func (vuo *VlanUpdateOne) AddVlanID(i int) *VlanUpdateOne

AddVlanID adds i to the "vlan_id" field.

func (*VlanUpdateOne) AddVlanIDs

func (vuo *VlanUpdateOne) AddVlanIDs(ids ...int) *VlanUpdateOne

AddVlanIDs adds the "vlans" edge to the NetInterface entity by IDs.

func (*VlanUpdateOne) AddVlans

func (vuo *VlanUpdateOne) AddVlans(n ...*NetInterface) *VlanUpdateOne

AddVlans adds the "vlans" edges to the NetInterface entity.

func (*VlanUpdateOne) ClearNativeVlan

func (vuo *VlanUpdateOne) ClearNativeVlan() *VlanUpdateOne

ClearNativeVlan clears all "native_vlan" edges to the NetInterface entity.

func (*VlanUpdateOne) ClearOnDevice

func (vuo *VlanUpdateOne) ClearOnDevice() *VlanUpdateOne

ClearOnDevice clears all "on_device" edges to the Device entity.

func (*VlanUpdateOne) ClearPoNativeVlan added in v0.2.0

func (vuo *VlanUpdateOne) ClearPoNativeVlan() *VlanUpdateOne

ClearPoNativeVlan clears all "po_native_vlan" edges to the PortChannelInterface entity.

func (*VlanUpdateOne) ClearPoVlans added in v0.2.0

func (vuo *VlanUpdateOne) ClearPoVlans() *VlanUpdateOne

ClearPoVlans clears all "po_vlans" edges to the PortChannelInterface entity.

func (*VlanUpdateOne) ClearVlans

func (vuo *VlanUpdateOne) ClearVlans() *VlanUpdateOne

ClearVlans clears all "vlans" edges to the NetInterface entity.

func (*VlanUpdateOne) Exec

func (vuo *VlanUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*VlanUpdateOne) ExecX

func (vuo *VlanUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*VlanUpdateOne) Mutation

func (vuo *VlanUpdateOne) Mutation() *VlanMutation

Mutation returns the VlanMutation object of the builder.

func (*VlanUpdateOne) RemoveNativeVlan

func (vuo *VlanUpdateOne) RemoveNativeVlan(n ...*NetInterface) *VlanUpdateOne

RemoveNativeVlan removes "native_vlan" edges to NetInterface entities.

func (*VlanUpdateOne) RemoveNativeVlanIDs

func (vuo *VlanUpdateOne) RemoveNativeVlanIDs(ids ...int) *VlanUpdateOne

RemoveNativeVlanIDs removes the "native_vlan" edge to NetInterface entities by IDs.

func (*VlanUpdateOne) RemoveOnDevice

func (vuo *VlanUpdateOne) RemoveOnDevice(d ...*Device) *VlanUpdateOne

RemoveOnDevice removes "on_device" edges to Device entities.

func (*VlanUpdateOne) RemoveOnDeviceIDs

func (vuo *VlanUpdateOne) RemoveOnDeviceIDs(ids ...int) *VlanUpdateOne

RemoveOnDeviceIDs removes the "on_device" edge to Device entities by IDs.

func (*VlanUpdateOne) RemovePoNativeVlan added in v0.2.0

func (vuo *VlanUpdateOne) RemovePoNativeVlan(p ...*PortChannelInterface) *VlanUpdateOne

RemovePoNativeVlan removes "po_native_vlan" edges to PortChannelInterface entities.

func (*VlanUpdateOne) RemovePoNativeVlanIDs added in v0.2.0

func (vuo *VlanUpdateOne) RemovePoNativeVlanIDs(ids ...int) *VlanUpdateOne

RemovePoNativeVlanIDs removes the "po_native_vlan" edge to PortChannelInterface entities by IDs.

func (*VlanUpdateOne) RemovePoVlanIDs added in v0.2.0

func (vuo *VlanUpdateOne) RemovePoVlanIDs(ids ...int) *VlanUpdateOne

RemovePoVlanIDs removes the "po_vlans" edge to PortChannelInterface entities by IDs.

func (*VlanUpdateOne) RemovePoVlans added in v0.2.0

func (vuo *VlanUpdateOne) RemovePoVlans(p ...*PortChannelInterface) *VlanUpdateOne

RemovePoVlans removes "po_vlans" edges to PortChannelInterface entities.

func (*VlanUpdateOne) RemoveVlanIDs

func (vuo *VlanUpdateOne) RemoveVlanIDs(ids ...int) *VlanUpdateOne

RemoveVlanIDs removes the "vlans" edge to NetInterface entities by IDs.

func (*VlanUpdateOne) RemoveVlans

func (vuo *VlanUpdateOne) RemoveVlans(n ...*NetInterface) *VlanUpdateOne

RemoveVlans removes "vlans" edges to NetInterface entities.

func (*VlanUpdateOne) Save

func (vuo *VlanUpdateOne) Save(ctx context.Context) (*Vlan, error)

Save executes the query and returns the updated Vlan entity.

func (*VlanUpdateOne) SaveX

func (vuo *VlanUpdateOne) SaveX(ctx context.Context) *Vlan

SaveX is like Save, but panics if an error occurs.

func (*VlanUpdateOne) Select

func (vuo *VlanUpdateOne) Select(field string, fields ...string) *VlanUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*VlanUpdateOne) SetVlanID

func (vuo *VlanUpdateOne) SetVlanID(i int) *VlanUpdateOne

SetVlanID sets the "vlan_id" field.

type Vlans

type Vlans []*Vlan

Vlans is a parsable slice of Vlan.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL