generated

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 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.
	TypeIPAddress   = "IPAddress"
	TypeIPBlock     = "IPBlock"
	TypeIPBlockType = "IPBlockType"
)

Variables

View Source
var (
	// IPAddressOrderFieldID orders IPAddress by id.
	IPAddressOrderFieldID = &IPAddressOrderField{
		Value: func(ia *IPAddress) (ent.Value, error) {
			return ia.ID, nil
		},
		column: ipaddress.FieldID,
		toTerm: ipaddress.ByID,
		toCursor: func(ia *IPAddress) Cursor {
			return Cursor{
				ID:    ia.ID,
				Value: ia.ID,
			}
		},
	}
	// IPAddressOrderFieldCreatedAt orders IPAddress by created_at.
	IPAddressOrderFieldCreatedAt = &IPAddressOrderField{
		Value: func(ia *IPAddress) (ent.Value, error) {
			return ia.CreatedAt, nil
		},
		column: ipaddress.FieldCreatedAt,
		toTerm: ipaddress.ByCreatedAt,
		toCursor: func(ia *IPAddress) Cursor {
			return Cursor{
				ID:    ia.ID,
				Value: ia.CreatedAt,
			}
		},
	}
	// IPAddressOrderFieldUpdatedAt orders IPAddress by updated_at.
	IPAddressOrderFieldUpdatedAt = &IPAddressOrderField{
		Value: func(ia *IPAddress) (ent.Value, error) {
			return ia.UpdatedAt, nil
		},
		column: ipaddress.FieldUpdatedAt,
		toTerm: ipaddress.ByUpdatedAt,
		toCursor: func(ia *IPAddress) Cursor {
			return Cursor{
				ID:    ia.ID,
				Value: ia.UpdatedAt,
			}
		},
	}
	// IPAddressOrderFieldIP orders IPAddress by IP.
	IPAddressOrderFieldIP = &IPAddressOrderField{
		Value: func(ia *IPAddress) (ent.Value, error) {
			return ia.IP, nil
		},
		column: ipaddress.FieldIP,
		toTerm: ipaddress.ByIP,
		toCursor: func(ia *IPAddress) Cursor {
			return Cursor{
				ID:    ia.ID,
				Value: ia.IP,
			}
		},
	}
	// IPAddressOrderFieldBlockID orders IPAddress by block_id.
	IPAddressOrderFieldBlockID = &IPAddressOrderField{
		Value: func(ia *IPAddress) (ent.Value, error) {
			return ia.BlockID, nil
		},
		column: ipaddress.FieldBlockID,
		toTerm: ipaddress.ByBlockID,
		toCursor: func(ia *IPAddress) Cursor {
			return Cursor{
				ID:    ia.ID,
				Value: ia.BlockID,
			}
		},
	}
	// IPAddressOrderFieldNodeID orders IPAddress by node_id.
	IPAddressOrderFieldNodeID = &IPAddressOrderField{
		Value: func(ia *IPAddress) (ent.Value, error) {
			return ia.NodeID, nil
		},
		column: ipaddress.FieldNodeID,
		toTerm: ipaddress.ByNodeID,
		toCursor: func(ia *IPAddress) Cursor {
			return Cursor{
				ID:    ia.ID,
				Value: ia.NodeID,
			}
		},
	}
	// IPAddressOrderFieldNodeOwnerID orders IPAddress by node_owner_id.
	IPAddressOrderFieldNodeOwnerID = &IPAddressOrderField{
		Value: func(ia *IPAddress) (ent.Value, error) {
			return ia.NodeOwnerID, nil
		},
		column: ipaddress.FieldNodeOwnerID,
		toTerm: ipaddress.ByNodeOwnerID,
		toCursor: func(ia *IPAddress) Cursor {
			return Cursor{
				ID:    ia.ID,
				Value: ia.NodeOwnerID,
			}
		},
	}
	// IPAddressOrderFieldReserved orders IPAddress by reserved.
	IPAddressOrderFieldReserved = &IPAddressOrderField{
		Value: func(ia *IPAddress) (ent.Value, error) {
			return ia.Reserved, nil
		},
		column: ipaddress.FieldReserved,
		toTerm: ipaddress.ByReserved,
		toCursor: func(ia *IPAddress) Cursor {
			return Cursor{
				ID:    ia.ID,
				Value: ia.Reserved,
			}
		},
	}
)
View Source
var (
	// IPBlockOrderFieldID orders IPBlock by id.
	IPBlockOrderFieldID = &IPBlockOrderField{
		Value: func(ib *IPBlock) (ent.Value, error) {
			return ib.ID, nil
		},
		column: ipblock.FieldID,
		toTerm: ipblock.ByID,
		toCursor: func(ib *IPBlock) Cursor {
			return Cursor{
				ID:    ib.ID,
				Value: ib.ID,
			}
		},
	}
	// IPBlockOrderFieldCreatedAt orders IPBlock by created_at.
	IPBlockOrderFieldCreatedAt = &IPBlockOrderField{
		Value: func(ib *IPBlock) (ent.Value, error) {
			return ib.CreatedAt, nil
		},
		column: ipblock.FieldCreatedAt,
		toTerm: ipblock.ByCreatedAt,
		toCursor: func(ib *IPBlock) Cursor {
			return Cursor{
				ID:    ib.ID,
				Value: ib.CreatedAt,
			}
		},
	}
	// IPBlockOrderFieldUpdatedAt orders IPBlock by updated_at.
	IPBlockOrderFieldUpdatedAt = &IPBlockOrderField{
		Value: func(ib *IPBlock) (ent.Value, error) {
			return ib.UpdatedAt, nil
		},
		column: ipblock.FieldUpdatedAt,
		toTerm: ipblock.ByUpdatedAt,
		toCursor: func(ib *IPBlock) Cursor {
			return Cursor{
				ID:    ib.ID,
				Value: ib.UpdatedAt,
			}
		},
	}
	// IPBlockOrderFieldPrefix orders IPBlock by prefix.
	IPBlockOrderFieldPrefix = &IPBlockOrderField{
		Value: func(ib *IPBlock) (ent.Value, error) {
			return ib.Prefix, nil
		},
		column: ipblock.FieldPrefix,
		toTerm: ipblock.ByPrefix,
		toCursor: func(ib *IPBlock) Cursor {
			return Cursor{
				ID:    ib.ID,
				Value: ib.Prefix,
			}
		},
	}
	// IPBlockOrderFieldBlockTypeID orders IPBlock by block_type_id.
	IPBlockOrderFieldBlockTypeID = &IPBlockOrderField{
		Value: func(ib *IPBlock) (ent.Value, error) {
			return ib.BlockTypeID, nil
		},
		column: ipblock.FieldBlockTypeID,
		toTerm: ipblock.ByBlockTypeID,
		toCursor: func(ib *IPBlock) Cursor {
			return Cursor{
				ID:    ib.ID,
				Value: ib.BlockTypeID,
			}
		},
	}
	// IPBlockOrderFieldLocationID orders IPBlock by location_id.
	IPBlockOrderFieldLocationID = &IPBlockOrderField{
		Value: func(ib *IPBlock) (ent.Value, error) {
			return ib.LocationID, nil
		},
		column: ipblock.FieldLocationID,
		toTerm: ipblock.ByLocationID,
		toCursor: func(ib *IPBlock) Cursor {
			return Cursor{
				ID:    ib.ID,
				Value: ib.LocationID,
			}
		},
	}
	// IPBlockOrderFieldParentBlockID orders IPBlock by parent_block_id.
	IPBlockOrderFieldParentBlockID = &IPBlockOrderField{
		Value: func(ib *IPBlock) (ent.Value, error) {
			return ib.ParentBlockID, nil
		},
		column: ipblock.FieldParentBlockID,
		toTerm: ipblock.ByParentBlockID,
		toCursor: func(ib *IPBlock) Cursor {
			return Cursor{
				ID:    ib.ID,
				Value: ib.ParentBlockID,
			}
		},
	}
	// IPBlockOrderFieldAllowAutoSubnet orders IPBlock by allow_auto_subnet.
	IPBlockOrderFieldAllowAutoSubnet = &IPBlockOrderField{
		Value: func(ib *IPBlock) (ent.Value, error) {
			return ib.AllowAutoSubnet, nil
		},
		column: ipblock.FieldAllowAutoSubnet,
		toTerm: ipblock.ByAllowAutoSubnet,
		toCursor: func(ib *IPBlock) Cursor {
			return Cursor{
				ID:    ib.ID,
				Value: ib.AllowAutoSubnet,
			}
		},
	}
	// IPBlockOrderFieldAllowAutoAllocate orders IPBlock by allow_auto_allocate.
	IPBlockOrderFieldAllowAutoAllocate = &IPBlockOrderField{
		Value: func(ib *IPBlock) (ent.Value, error) {
			return ib.AllowAutoAllocate, nil
		},
		column: ipblock.FieldAllowAutoAllocate,
		toTerm: ipblock.ByAllowAutoAllocate,
		toCursor: func(ib *IPBlock) Cursor {
			return Cursor{
				ID:    ib.ID,
				Value: ib.AllowAutoAllocate,
			}
		},
	}
)
View Source
var (
	// IPBlockTypeOrderFieldID orders IPBlockType by id.
	IPBlockTypeOrderFieldID = &IPBlockTypeOrderField{
		Value: func(ibt *IPBlockType) (ent.Value, error) {
			return ibt.ID, nil
		},
		column: ipblocktype.FieldID,
		toTerm: ipblocktype.ByID,
		toCursor: func(ibt *IPBlockType) Cursor {
			return Cursor{
				ID:    ibt.ID,
				Value: ibt.ID,
			}
		},
	}
	// IPBlockTypeOrderFieldCreatedAt orders IPBlockType by created_at.
	IPBlockTypeOrderFieldCreatedAt = &IPBlockTypeOrderField{
		Value: func(ibt *IPBlockType) (ent.Value, error) {
			return ibt.CreatedAt, nil
		},
		column: ipblocktype.FieldCreatedAt,
		toTerm: ipblocktype.ByCreatedAt,
		toCursor: func(ibt *IPBlockType) Cursor {
			return Cursor{
				ID:    ibt.ID,
				Value: ibt.CreatedAt,
			}
		},
	}
	// IPBlockTypeOrderFieldUpdatedAt orders IPBlockType by updated_at.
	IPBlockTypeOrderFieldUpdatedAt = &IPBlockTypeOrderField{
		Value: func(ibt *IPBlockType) (ent.Value, error) {
			return ibt.UpdatedAt, nil
		},
		column: ipblocktype.FieldUpdatedAt,
		toTerm: ipblocktype.ByUpdatedAt,
		toCursor: func(ibt *IPBlockType) Cursor {
			return Cursor{
				ID:    ibt.ID,
				Value: ibt.UpdatedAt,
			}
		},
	}
	// IPBlockTypeOrderFieldName orders IPBlockType by name.
	IPBlockTypeOrderFieldName = &IPBlockTypeOrderField{
		Value: func(ibt *IPBlockType) (ent.Value, error) {
			return ibt.Name, nil
		},
		column: ipblocktype.FieldName,
		toTerm: ipblocktype.ByName,
		toCursor: func(ibt *IPBlockType) Cursor {
			return Cursor{
				ID:    ibt.ID,
				Value: ibt.Name,
			}
		},
	}
	// IPBlockTypeOrderFieldOwnerID orders IPBlockType by owner_id.
	IPBlockTypeOrderFieldOwnerID = &IPBlockTypeOrderField{
		Value: func(ibt *IPBlockType) (ent.Value, error) {
			return ibt.OwnerID, nil
		},
		column: ipblocktype.FieldOwnerID,
		toTerm: ipblocktype.ByOwnerID,
		toCursor: func(ibt *IPBlockType) Cursor {
			return Cursor{
				ID:    ibt.ID,
				Value: ibt.OwnerID,
			}
		},
	}
)
View Source
var DefaultIPAddressOrder = &IPAddressOrder{
	Direction: entgql.OrderDirectionAsc,
	Field: &IPAddressOrderField{
		Value: func(ia *IPAddress) (ent.Value, error) {
			return ia.ID, nil
		},
		column: ipaddress.FieldID,
		toTerm: ipaddress.ByID,
		toCursor: func(ia *IPAddress) Cursor {
			return Cursor{ID: ia.ID}
		},
	},
}

DefaultIPAddressOrder is the default ordering of IPAddress.

View Source
var DefaultIPBlockOrder = &IPBlockOrder{
	Direction: entgql.OrderDirectionAsc,
	Field: &IPBlockOrderField{
		Value: func(ib *IPBlock) (ent.Value, error) {
			return ib.ID, nil
		},
		column: ipblock.FieldID,
		toTerm: ipblock.ByID,
		toCursor: func(ib *IPBlock) Cursor {
			return Cursor{ID: ib.ID}
		},
	},
}

DefaultIPBlockOrder is the default ordering of IPBlock.

View Source
var DefaultIPBlockTypeOrder = &IPBlockTypeOrder{
	Direction: entgql.OrderDirectionAsc,
	Field: &IPBlockTypeOrderField{
		Value: func(ibt *IPBlockType) (ent.Value, error) {
			return ibt.ID, nil
		},
		column: ipblocktype.FieldID,
		toTerm: ipblocktype.ByID,
		toCursor: func(ibt *IPBlockType) Cursor {
			return Cursor{ID: ibt.ID}
		},
	},
}

DefaultIPBlockTypeOrder is the default ordering of IPBlockType.

View Source
var ErrEmptyIPAddressWhereInput = errors.New("generated: empty predicate IPAddressWhereInput")

ErrEmptyIPAddressWhereInput is returned in case the IPAddressWhereInput is empty.

View Source
var ErrEmptyIPBlockTypeWhereInput = errors.New("generated: empty predicate IPBlockTypeWhereInput")

ErrEmptyIPBlockTypeWhereInput is returned in case the IPBlockTypeWhereInput is empty.

View Source
var ErrEmptyIPBlockWhereInput = errors.New("generated: empty predicate IPBlockWhereInput")

ErrEmptyIPBlockWhereInput is returned in case the IPBlockWhereInput is empty.

View Source
var ErrTxStarted = errors.New("generated: cannot start a transaction within a transaction")

ErrTxStarted is returned when trying to start a new transaction from a transactional client.

Functions

func Asc

func Asc(fields ...string) func(*sql.Selector)

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) func(*sql.Selector)

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

func OpenTxFromContext

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

OpenTxFromContext open transactions from client stored in context.

Types

type 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(generated.As(generated.Sum(field1), "sum_field1"), (generated.As(generated.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
	// IPAddress is the client for interacting with the IPAddress builders.
	IPAddress *IPAddressClient
	// IPBlock is the client for interacting with the IPBlock builders.
	IPBlock *IPBlockClient
	// IPBlockType is the client for interacting with the IPBlockType builders.
	IPBlockType *IPBlockTypeClient
	// 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().
	IPAddress.
	Query().
	Count(ctx)

func (*Client) Intercept

func (c *Client) Intercept(interceptors ...Interceptor)

Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.

func (*Client) Mutate

func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)

Mutate implements the ent.Mutator interface.

func (*Client) Noder

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

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

c.Noder(ctx, id)
c.Noder(ctx, id, ent.WithNodeType(typeResolver))

func (*Client) Noders

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

func (*Client) OpenTx

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

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

func (*Client) Tx

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

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

func (*Client) Use

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

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

type CommitFunc

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

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

func (CommitFunc) Commit

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

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

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

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

type Committer

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

Committer is the interface that wraps the Commit method.

type 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 CreateIPAddressInput

type CreateIPAddressInput struct {
	IP          string
	NodeID      gidx.PrefixedID
	NodeOwnerID gidx.PrefixedID
	Reserved    *bool
	IPBlockID   gidx.PrefixedID
}

CreateIPAddressInput represents a mutation input for creating ipaddresses.

func (*CreateIPAddressInput) Mutate

Mutate applies the CreateIPAddressInput on the IPAddressMutation builder.

type CreateIPBlockInput

type CreateIPBlockInput struct {
	Prefix            string
	LocationID        gidx.PrefixedID
	ParentBlockID     gidx.PrefixedID
	AllowAutoSubnet   *bool
	AllowAutoAllocate *bool
	IPBlockTypeID     gidx.PrefixedID
}

CreateIPBlockInput represents a mutation input for creating ipblocks.

func (*CreateIPBlockInput) Mutate

func (i *CreateIPBlockInput) Mutate(m *IPBlockMutation)

Mutate applies the CreateIPBlockInput on the IPBlockMutation builder.

type CreateIPBlockTypeInput

type CreateIPBlockTypeInput struct {
	Name    string
	OwnerID gidx.PrefixedID
}

CreateIPBlockTypeInput represents a mutation input for creating ipblocktypes.

func (*CreateIPBlockTypeInput) Mutate

Mutate applies the CreateIPBlockTypeInput on the IPBlockTypeMutation builder.

type Cursor

type Cursor = entgql.Cursor[gidx.PrefixedID]

Common entgql types.

type Hook

type Hook = ent.Hook

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

type IPAddress

type IPAddress struct {

	// ID of the ent.
	// The ID of the IP Address.
	ID gidx.PrefixedID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// The ip address.
	IP string `json:"IP,omitempty"`
	// The ID for the ip block for this ip address.
	BlockID gidx.PrefixedID `json:"block_id,omitempty"`
	// The ID for the node this is assigned to.
	NodeID gidx.PrefixedID `json:"node_id,omitempty"`
	// Owner ID of the node this is assigned to.
	NodeOwnerID gidx.PrefixedID `json:"node_owner_id,omitempty"`
	// Reserve the IP without it being assigned.
	Reserved bool `json:"reserved,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
}

Represents an ip address node on the graph.

func (*IPAddress) IPBlock

func (ia *IPAddress) IPBlock(ctx context.Context) (*IPBlock, error)

func (IPAddress) IsEntity

func (ia IPAddress) IsEntity()

IsEntity implement fedruntime.Entity

func (*IPAddress) IsNode

func (n *IPAddress) IsNode()

IsNode implements the Node interface check for GQLGen.

func (*IPAddress) QueryIPBlock

func (ia *IPAddress) QueryIPBlock() *IPBlockQuery

QueryIPBlock queries the "ip_block" edge of the IPAddress entity.

func (*IPAddress) String

func (ia *IPAddress) String() string

String implements the fmt.Stringer.

func (*IPAddress) ToEdge

func (ia *IPAddress) ToEdge(order *IPAddressOrder) *IPAddressEdge

ToEdge converts IPAddress into IPAddressEdge.

func (*IPAddress) Unwrap

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

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.

func (*IPAddress) Value

func (ia *IPAddress) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the IPAddress. This includes values selected through modifiers, order, etc.

type IPAddressClient

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

IPAddressClient is a client for the IPAddress schema.

func NewIPAddressClient

func NewIPAddressClient(c config) *IPAddressClient

NewIPAddressClient returns a client for the IPAddress from the given config.

func (*IPAddressClient) Create

func (c *IPAddressClient) Create() *IPAddressCreate

Create returns a builder for creating a IPAddress entity.

func (*IPAddressClient) CreateBulk

func (c *IPAddressClient) CreateBulk(builders ...*IPAddressCreate) *IPAddressCreateBulk

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

func (*IPAddressClient) Delete

func (c *IPAddressClient) Delete() *IPAddressDelete

Delete returns a delete builder for IPAddress.

func (*IPAddressClient) DeleteOne

func (c *IPAddressClient) DeleteOne(ia *IPAddress) *IPAddressDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*IPAddressClient) DeleteOneID

func (c *IPAddressClient) DeleteOneID(id gidx.PrefixedID) *IPAddressDeleteOne

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

func (*IPAddressClient) Get

Get returns a IPAddress entity by its id.

func (*IPAddressClient) GetX

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

func (*IPAddressClient) Hooks

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

Hooks returns the client hooks.

func (*IPAddressClient) Intercept

func (c *IPAddressClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `ipaddress.Intercept(f(g(h())))`.

func (*IPAddressClient) Interceptors

func (c *IPAddressClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*IPAddressClient) MapCreateBulk added in v0.2.0

func (c *IPAddressClient) MapCreateBulk(slice any, setFunc func(*IPAddressCreate, int)) *IPAddressCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*IPAddressClient) Query

func (c *IPAddressClient) Query() *IPAddressQuery

Query returns a query builder for IPAddress.

func (*IPAddressClient) QueryIPBlock

func (c *IPAddressClient) QueryIPBlock(ia *IPAddress) *IPBlockQuery

QueryIPBlock queries the ip_block edge of a IPAddress.

func (*IPAddressClient) Update

func (c *IPAddressClient) Update() *IPAddressUpdate

Update returns an update builder for IPAddress.

func (*IPAddressClient) UpdateOne

func (c *IPAddressClient) UpdateOne(ia *IPAddress) *IPAddressUpdateOne

UpdateOne returns an update builder for the given entity.

func (*IPAddressClient) UpdateOneID

func (c *IPAddressClient) UpdateOneID(id gidx.PrefixedID) *IPAddressUpdateOne

UpdateOneID returns an update builder for the given id.

func (*IPAddressClient) Use

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 IPAddressConnection

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

IPAddressConnection is the connection containing edges to IPAddress.

type IPAddressCreate

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

IPAddressCreate is the builder for creating a IPAddress entity.

func (*IPAddressCreate) Exec

func (iac *IPAddressCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*IPAddressCreate) ExecX

func (iac *IPAddressCreate) ExecX(ctx context.Context)

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

func (*IPAddressCreate) Mutation

func (iac *IPAddressCreate) Mutation() *IPAddressMutation

Mutation returns the IPAddressMutation object of the builder.

func (*IPAddressCreate) Save

func (iac *IPAddressCreate) Save(ctx context.Context) (*IPAddress, error)

Save creates the IPAddress in the database.

func (*IPAddressCreate) SaveX

func (iac *IPAddressCreate) SaveX(ctx context.Context) *IPAddress

SaveX calls Save and panics if Save returns an error.

func (*IPAddressCreate) SetBlockID

func (iac *IPAddressCreate) SetBlockID(gi gidx.PrefixedID) *IPAddressCreate

SetBlockID sets the "block_id" field.

func (*IPAddressCreate) SetCreatedAt

func (iac *IPAddressCreate) SetCreatedAt(t time.Time) *IPAddressCreate

SetCreatedAt sets the "created_at" field.

func (*IPAddressCreate) SetID

SetID sets the "id" field.

func (*IPAddressCreate) SetIP

func (iac *IPAddressCreate) SetIP(s string) *IPAddressCreate

SetIP sets the "IP" field.

func (*IPAddressCreate) SetIPBlock

func (iac *IPAddressCreate) SetIPBlock(i *IPBlock) *IPAddressCreate

SetIPBlock sets the "ip_block" edge to the IPBlock entity.

func (*IPAddressCreate) SetIPBlockID

func (iac *IPAddressCreate) SetIPBlockID(id gidx.PrefixedID) *IPAddressCreate

SetIPBlockID sets the "ip_block" edge to the IPBlock entity by ID.

func (*IPAddressCreate) SetInput

SetInput applies the change-set in the CreateIPAddressInput on the IPAddressCreate builder.

func (*IPAddressCreate) SetNillableCreatedAt

func (iac *IPAddressCreate) SetNillableCreatedAt(t *time.Time) *IPAddressCreate

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

func (*IPAddressCreate) SetNillableID

func (iac *IPAddressCreate) SetNillableID(gi *gidx.PrefixedID) *IPAddressCreate

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

func (*IPAddressCreate) SetNillableReserved

func (iac *IPAddressCreate) SetNillableReserved(b *bool) *IPAddressCreate

SetNillableReserved sets the "reserved" field if the given value is not nil.

func (*IPAddressCreate) SetNillableUpdatedAt

func (iac *IPAddressCreate) SetNillableUpdatedAt(t *time.Time) *IPAddressCreate

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

func (*IPAddressCreate) SetNodeID

func (iac *IPAddressCreate) SetNodeID(gi gidx.PrefixedID) *IPAddressCreate

SetNodeID sets the "node_id" field.

func (*IPAddressCreate) SetNodeOwnerID

func (iac *IPAddressCreate) SetNodeOwnerID(gi gidx.PrefixedID) *IPAddressCreate

SetNodeOwnerID sets the "node_owner_id" field.

func (*IPAddressCreate) SetReserved

func (iac *IPAddressCreate) SetReserved(b bool) *IPAddressCreate

SetReserved sets the "reserved" field.

func (*IPAddressCreate) SetUpdatedAt

func (iac *IPAddressCreate) SetUpdatedAt(t time.Time) *IPAddressCreate

SetUpdatedAt sets the "updated_at" field.

type IPAddressCreateBulk

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

IPAddressCreateBulk is the builder for creating many IPAddress entities in bulk.

func (*IPAddressCreateBulk) Exec

func (iacb *IPAddressCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*IPAddressCreateBulk) ExecX

func (iacb *IPAddressCreateBulk) ExecX(ctx context.Context)

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

func (*IPAddressCreateBulk) Save

func (iacb *IPAddressCreateBulk) Save(ctx context.Context) ([]*IPAddress, error)

Save creates the IPAddress entities in the database.

func (*IPAddressCreateBulk) SaveX

func (iacb *IPAddressCreateBulk) SaveX(ctx context.Context) []*IPAddress

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

type IPAddressDelete

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

IPAddressDelete is the builder for deleting a IPAddress entity.

func (*IPAddressDelete) Exec

func (iad *IPAddressDelete) Exec(ctx context.Context) (int, error)

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

func (*IPAddressDelete) ExecX

func (iad *IPAddressDelete) ExecX(ctx context.Context) int

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

func (*IPAddressDelete) Where

Where appends a list predicates to the IPAddressDelete builder.

type IPAddressDeleteOne

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

IPAddressDeleteOne is the builder for deleting a single IPAddress entity.

func (*IPAddressDeleteOne) Exec

func (iado *IPAddressDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*IPAddressDeleteOne) ExecX

func (iado *IPAddressDeleteOne) ExecX(ctx context.Context)

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

func (*IPAddressDeleteOne) Where

Where appends a list predicates to the IPAddressDelete builder.

type IPAddressEdge

type IPAddressEdge struct {
	Node   *IPAddress `json:"node"`
	Cursor Cursor     `json:"cursor"`
}

IPAddressEdge is the edge representation of IPAddress.

type IPAddressEdges

type IPAddressEdges struct {
	// IPBlock holds the value of the ip_block edge.
	IPBlock *IPBlock `json:"ip_block,omitempty"`
	// contains filtered or unexported fields
}

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

func (IPAddressEdges) IPBlockOrErr

func (e IPAddressEdges) IPBlockOrErr() (*IPBlock, error)

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

type IPAddressGroupBy

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

IPAddressGroupBy is the group-by builder for IPAddress entities.

func (*IPAddressGroupBy) Aggregate

func (iagb *IPAddressGroupBy) Aggregate(fns ...AggregateFunc) *IPAddressGroupBy

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

func (*IPAddressGroupBy) Bool

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

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

func (*IPAddressGroupBy) BoolX

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

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

func (*IPAddressGroupBy) Bools

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

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

func (*IPAddressGroupBy) BoolsX

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

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

func (*IPAddressGroupBy) Float64

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

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

func (*IPAddressGroupBy) Float64X

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

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

func (*IPAddressGroupBy) Float64s

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

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

func (*IPAddressGroupBy) Float64sX

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

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

func (*IPAddressGroupBy) Int

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

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

func (*IPAddressGroupBy) IntX

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

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

func (*IPAddressGroupBy) Ints

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

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

func (*IPAddressGroupBy) IntsX

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

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

func (*IPAddressGroupBy) Scan

func (iagb *IPAddressGroupBy) Scan(ctx context.Context, v any) error

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

func (*IPAddressGroupBy) ScanX

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

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

func (*IPAddressGroupBy) String

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

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

func (*IPAddressGroupBy) StringX

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

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

func (*IPAddressGroupBy) Strings

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

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

func (*IPAddressGroupBy) StringsX

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

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

type IPAddressMutation

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

IPAddressMutation represents an operation that mutates the IPAddress nodes in the graph.

func (*IPAddressMutation) AddField

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) AddedEdges

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

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

func (*IPAddressMutation) AddedField

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

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

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

func (*IPAddressMutation) AddedIDs

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) BlockID

func (m *IPAddressMutation) BlockID() (r gidx.PrefixedID, exists bool)

BlockID returns the value of the "block_id" field in the mutation.

func (*IPAddressMutation) ClearEdge

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

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) ClearIPBlock

func (m *IPAddressMutation) ClearIPBlock()

ClearIPBlock clears the "ip_block" edge to the IPBlock entity.

func (*IPAddressMutation) ClearedEdges

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

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

func (*IPAddressMutation) ClearedFields

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

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

func (IPAddressMutation) Client

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) CreatedAt

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

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

func (*IPAddressMutation) EdgeCleared

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

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

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

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

func (m *IPAddressMutation) ID() (id gidx.PrefixedID, exists bool)

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

func (*IPAddressMutation) IDs

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

func (*IPAddressMutation) IP

func (m *IPAddressMutation) IP() (r string, exists bool)

IP returns the value of the "IP" field in the mutation.

func (*IPAddressMutation) IPBlockCleared

func (m *IPAddressMutation) IPBlockCleared() bool

IPBlockCleared reports if the "ip_block" edge to the IPBlock entity was cleared.

func (*IPAddressMutation) IPBlockID

func (m *IPAddressMutation) IPBlockID() (id gidx.PrefixedID, exists bool)

IPBlockID returns the "ip_block" edge ID in the mutation.

func (*IPAddressMutation) IPBlockIDs

func (m *IPAddressMutation) IPBlockIDs() (ids []gidx.PrefixedID)

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

func (*IPAddressMutation) NodeID

func (m *IPAddressMutation) NodeID() (r gidx.PrefixedID, exists bool)

NodeID returns the value of the "node_id" field in the mutation.

func (*IPAddressMutation) NodeOwnerID

func (m *IPAddressMutation) NodeOwnerID() (r gidx.PrefixedID, exists bool)

NodeOwnerID returns the value of the "node_owner_id" field in the mutation.

func (*IPAddressMutation) OldBlockID

func (m *IPAddressMutation) OldBlockID(ctx context.Context) (v gidx.PrefixedID, err error)

OldBlockID returns the old "block_id" 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) OldCreatedAt

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

OldCreatedAt returns the old "created_at" 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) OldField

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) OldIP

func (m *IPAddressMutation) OldIP(ctx context.Context) (v string, err error)

OldIP returns the old "IP" 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) OldNodeID

func (m *IPAddressMutation) OldNodeID(ctx context.Context) (v gidx.PrefixedID, err error)

OldNodeID returns the old "node_id" 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) OldNodeOwnerID

func (m *IPAddressMutation) OldNodeOwnerID(ctx context.Context) (v gidx.PrefixedID, err error)

OldNodeOwnerID returns the old "node_owner_id" 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) OldReserved

func (m *IPAddressMutation) OldReserved(ctx context.Context) (v bool, err error)

OldReserved returns the old "reserved" 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) OldUpdatedAt

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

OldUpdatedAt returns the old "updated_at" 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) Op

func (m *IPAddressMutation) Op() Op

Op returns the operation name.

func (*IPAddressMutation) RemovedEdges

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

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

func (*IPAddressMutation) RemovedIDs

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) Reserved

func (m *IPAddressMutation) Reserved() (r bool, exists bool)

Reserved returns the value of the "reserved" field in the mutation.

func (*IPAddressMutation) ResetBlockID

func (m *IPAddressMutation) ResetBlockID()

ResetBlockID resets all changes to the "block_id" field.

func (*IPAddressMutation) ResetCreatedAt

func (m *IPAddressMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*IPAddressMutation) ResetEdge

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

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) ResetIP

func (m *IPAddressMutation) ResetIP()

ResetIP resets all changes to the "IP" field.

func (*IPAddressMutation) ResetIPBlock

func (m *IPAddressMutation) ResetIPBlock()

ResetIPBlock resets all changes to the "ip_block" edge.

func (*IPAddressMutation) ResetNodeID

func (m *IPAddressMutation) ResetNodeID()

ResetNodeID resets all changes to the "node_id" field.

func (*IPAddressMutation) ResetNodeOwnerID

func (m *IPAddressMutation) ResetNodeOwnerID()

ResetNodeOwnerID resets all changes to the "node_owner_id" field.

func (*IPAddressMutation) ResetReserved

func (m *IPAddressMutation) ResetReserved()

ResetReserved resets all changes to the "reserved" field.

func (*IPAddressMutation) ResetUpdatedAt

func (m *IPAddressMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*IPAddressMutation) SetBlockID

func (m *IPAddressMutation) SetBlockID(gi gidx.PrefixedID)

SetBlockID sets the "block_id" field.

func (*IPAddressMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*IPAddressMutation) SetField

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) SetID

func (m *IPAddressMutation) SetID(id gidx.PrefixedID)

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

func (*IPAddressMutation) SetIP

func (m *IPAddressMutation) SetIP(s string)

SetIP sets the "IP" field.

func (*IPAddressMutation) SetIPBlockID

func (m *IPAddressMutation) SetIPBlockID(id gidx.PrefixedID)

SetIPBlockID sets the "ip_block" edge to the IPBlock entity by id.

func (*IPAddressMutation) SetNodeID

func (m *IPAddressMutation) SetNodeID(gi gidx.PrefixedID)

SetNodeID sets the "node_id" field.

func (*IPAddressMutation) SetNodeOwnerID

func (m *IPAddressMutation) SetNodeOwnerID(gi gidx.PrefixedID)

SetNodeOwnerID sets the "node_owner_id" field.

func (*IPAddressMutation) SetOp

func (m *IPAddressMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*IPAddressMutation) SetReserved

func (m *IPAddressMutation) SetReserved(b bool)

SetReserved sets the "reserved" field.

func (*IPAddressMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (IPAddressMutation) Tx

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

func (m *IPAddressMutation) Type() string

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

func (*IPAddressMutation) UpdatedAt

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

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

func (*IPAddressMutation) Where

func (m *IPAddressMutation) Where(ps ...predicate.IPAddress)

Where appends a list predicates to the IPAddressMutation builder.

func (*IPAddressMutation) WhereP

func (m *IPAddressMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the IPAddressMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type IPAddressOrder

type IPAddressOrder struct {
	Direction OrderDirection       `json:"direction"`
	Field     *IPAddressOrderField `json:"field"`
}

IPAddressOrder defines the ordering of IPAddress.

type IPAddressOrderField

type IPAddressOrderField struct {
	// Value extracts the ordering value from the given IPAddress.
	Value func(*IPAddress) (ent.Value, error)
	// contains filtered or unexported fields
}

IPAddressOrderField defines the ordering field of IPAddress.

func (IPAddressOrderField) MarshalGQL

func (f IPAddressOrderField) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (IPAddressOrderField) String

func (f IPAddressOrderField) String() string

String implement fmt.Stringer interface.

func (*IPAddressOrderField) UnmarshalGQL

func (f *IPAddressOrderField) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

type IPAddressPaginateOption

type IPAddressPaginateOption func(*ipaddressPager) error

IPAddressPaginateOption enables pagination customization.

func WithIPAddressFilter

func WithIPAddressFilter(filter func(*IPAddressQuery) (*IPAddressQuery, error)) IPAddressPaginateOption

WithIPAddressFilter configures pagination filter.

func WithIPAddressOrder

func WithIPAddressOrder(order *IPAddressOrder) IPAddressPaginateOption

WithIPAddressOrder configures pagination ordering.

type IPAddressQuery

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

IPAddressQuery is the builder for querying IPAddress entities.

func (*IPAddressQuery) Aggregate

func (iaq *IPAddressQuery) Aggregate(fns ...AggregateFunc) *IPAddressSelect

Aggregate returns a IPAddressSelect configured with the given aggregations.

func (*IPAddressQuery) All

func (iaq *IPAddressQuery) All(ctx context.Context) ([]*IPAddress, error)

All executes the query and returns a list of IPAddresses.

func (*IPAddressQuery) AllX

func (iaq *IPAddressQuery) AllX(ctx context.Context) []*IPAddress

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

func (*IPAddressQuery) Clone

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) CollectFields

func (ia *IPAddressQuery) CollectFields(ctx context.Context, satisfies ...string) (*IPAddressQuery, error)

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

func (*IPAddressQuery) Count

func (iaq *IPAddressQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*IPAddressQuery) CountX

func (iaq *IPAddressQuery) CountX(ctx context.Context) int

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

func (*IPAddressQuery) Exist

func (iaq *IPAddressQuery) Exist(ctx context.Context) (bool, error)

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

func (*IPAddressQuery) ExistX

func (iaq *IPAddressQuery) ExistX(ctx context.Context) bool

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

func (*IPAddressQuery) First

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

func (iaq *IPAddressQuery) FirstID(ctx context.Context) (id gidx.PrefixedID, err error)

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

func (*IPAddressQuery) FirstIDX

func (iaq *IPAddressQuery) FirstIDX(ctx context.Context) gidx.PrefixedID

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

func (*IPAddressQuery) FirstX

func (iaq *IPAddressQuery) FirstX(ctx context.Context) *IPAddress

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

func (*IPAddressQuery) GroupBy

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

client.IPAddress.Query().
	GroupBy(ipaddress.FieldCreatedAt).
	Aggregate(generated.Count()).
	Scan(ctx, &v)

func (*IPAddressQuery) IDs

func (iaq *IPAddressQuery) IDs(ctx context.Context) (ids []gidx.PrefixedID, err error)

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

func (*IPAddressQuery) IDsX

func (iaq *IPAddressQuery) IDsX(ctx context.Context) []gidx.PrefixedID

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

func (*IPAddressQuery) Limit

func (iaq *IPAddressQuery) Limit(limit int) *IPAddressQuery

Limit the number of records to be returned by this query.

func (*IPAddressQuery) Offset

func (iaq *IPAddressQuery) Offset(offset int) *IPAddressQuery

Offset to start from.

func (*IPAddressQuery) Only

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 more than one IPAddress entity is found. Returns a *NotFoundError when no IPAddress entities are found.

func (*IPAddressQuery) OnlyID

func (iaq *IPAddressQuery) OnlyID(ctx context.Context) (id gidx.PrefixedID, err error)

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

func (*IPAddressQuery) OnlyIDX

func (iaq *IPAddressQuery) OnlyIDX(ctx context.Context) gidx.PrefixedID

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

func (*IPAddressQuery) OnlyX

func (iaq *IPAddressQuery) OnlyX(ctx context.Context) *IPAddress

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

func (*IPAddressQuery) Order

Order specifies how the records should be ordered.

func (*IPAddressQuery) Paginate

func (ia *IPAddressQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...IPAddressPaginateOption,
) (*IPAddressConnection, error)

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

func (*IPAddressQuery) QueryIPBlock

func (iaq *IPAddressQuery) QueryIPBlock() *IPBlockQuery

QueryIPBlock chains the current query on the "ip_block" edge.

func (*IPAddressQuery) Select

func (iaq *IPAddressQuery) Select(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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.IPAddress.Query().
	Select(ipaddress.FieldCreatedAt).
	Scan(ctx, &v)

func (*IPAddressQuery) Unique

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

func (iaq *IPAddressQuery) Where(ps ...predicate.IPAddress) *IPAddressQuery

Where adds a new predicate for the IPAddressQuery builder.

func (*IPAddressQuery) WithIPBlock

func (iaq *IPAddressQuery) WithIPBlock(opts ...func(*IPBlockQuery)) *IPAddressQuery

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

type IPAddressSelect

type IPAddressSelect struct {
	*IPAddressQuery
	// contains filtered or unexported fields
}

IPAddressSelect is the builder for selecting fields of IPAddress entities.

func (*IPAddressSelect) Aggregate

func (ias *IPAddressSelect) Aggregate(fns ...AggregateFunc) *IPAddressSelect

Aggregate adds the given aggregation functions to the selector query.

func (*IPAddressSelect) Bool

func (s *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

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

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

func (*IPAddressSelect) Bools

func (s *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

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

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

func (*IPAddressSelect) Float64

func (s *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

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

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

func (*IPAddressSelect) Float64s

func (s *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

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

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

func (*IPAddressSelect) Int

func (s *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

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

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

func (*IPAddressSelect) Ints

func (s *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

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

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

func (*IPAddressSelect) Scan

func (ias *IPAddressSelect) Scan(ctx context.Context, v any) error

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

func (*IPAddressSelect) ScanX

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

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

func (*IPAddressSelect) String

func (s *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

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

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

func (*IPAddressSelect) Strings

func (s *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

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

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

type IPAddressUpdate

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

IPAddressUpdate is the builder for updating IPAddress entities.

func (*IPAddressUpdate) Exec

func (iau *IPAddressUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*IPAddressUpdate) ExecX

func (iau *IPAddressUpdate) ExecX(ctx context.Context)

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

func (*IPAddressUpdate) Mutation

func (iau *IPAddressUpdate) Mutation() *IPAddressMutation

Mutation returns the IPAddressMutation object of the builder.

func (*IPAddressUpdate) Save

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

func (iau *IPAddressUpdate) SaveX(ctx context.Context) int

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

func (*IPAddressUpdate) SetIP

func (iau *IPAddressUpdate) SetIP(s string) *IPAddressUpdate

SetIP sets the "IP" field.

func (*IPAddressUpdate) SetInput

SetInput applies the change-set in the UpdateIPAddressInput on the IPAddressUpdate builder.

func (*IPAddressUpdate) SetNillableReserved

func (iau *IPAddressUpdate) SetNillableReserved(b *bool) *IPAddressUpdate

SetNillableReserved sets the "reserved" field if the given value is not nil.

func (*IPAddressUpdate) SetReserved

func (iau *IPAddressUpdate) SetReserved(b bool) *IPAddressUpdate

SetReserved sets the "reserved" field.

func (*IPAddressUpdate) Where

Where appends a list predicates to the IPAddressUpdate builder.

type IPAddressUpdateOne

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

IPAddressUpdateOne is the builder for updating a single IPAddress entity.

func (*IPAddressUpdateOne) Exec

func (iauo *IPAddressUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*IPAddressUpdateOne) ExecX

func (iauo *IPAddressUpdateOne) ExecX(ctx context.Context)

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

func (*IPAddressUpdateOne) Mutation

func (iauo *IPAddressUpdateOne) Mutation() *IPAddressMutation

Mutation returns the IPAddressMutation object of the builder.

func (*IPAddressUpdateOne) Save

func (iauo *IPAddressUpdateOne) Save(ctx context.Context) (*IPAddress, error)

Save executes the query and returns the updated IPAddress entity.

func (*IPAddressUpdateOne) SaveX

func (iauo *IPAddressUpdateOne) SaveX(ctx context.Context) *IPAddress

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

func (*IPAddressUpdateOne) Select

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) SetIP

SetIP sets the "IP" field.

func (*IPAddressUpdateOne) SetInput

SetInput applies the change-set in the UpdateIPAddressInput on the IPAddressUpdateOne builder.

func (*IPAddressUpdateOne) SetNillableReserved

func (iauo *IPAddressUpdateOne) SetNillableReserved(b *bool) *IPAddressUpdateOne

SetNillableReserved sets the "reserved" field if the given value is not nil.

func (*IPAddressUpdateOne) SetReserved

func (iauo *IPAddressUpdateOne) SetReserved(b bool) *IPAddressUpdateOne

SetReserved sets the "reserved" field.

func (*IPAddressUpdateOne) Where

Where appends a list predicates to the IPAddressUpdate builder.

type IPAddressWhereInput

type IPAddressWhereInput struct {
	Predicates []predicate.IPAddress  `json:"-"`
	Not        *IPAddressWhereInput   `json:"not,omitempty"`
	Or         []*IPAddressWhereInput `json:"or,omitempty"`
	And        []*IPAddressWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID      *gidx.PrefixedID  `json:"id,omitempty"`
	IDNEQ   *gidx.PrefixedID  `json:"idNEQ,omitempty"`
	IDIn    []gidx.PrefixedID `json:"idIn,omitempty"`
	IDNotIn []gidx.PrefixedID `json:"idNotIn,omitempty"`
	IDGT    *gidx.PrefixedID  `json:"idGT,omitempty"`
	IDGTE   *gidx.PrefixedID  `json:"idGTE,omitempty"`
	IDLT    *gidx.PrefixedID  `json:"idLT,omitempty"`
	IDLTE   *gidx.PrefixedID  `json:"idLTE,omitempty"`

	// "created_at" field predicates.
	CreatedAt      *time.Time  `json:"createdAt,omitempty"`
	CreatedAtNEQ   *time.Time  `json:"createdAtNEQ,omitempty"`
	CreatedAtIn    []time.Time `json:"createdAtIn,omitempty"`
	CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"`
	CreatedAtGT    *time.Time  `json:"createdAtGT,omitempty"`
	CreatedAtGTE   *time.Time  `json:"createdAtGTE,omitempty"`
	CreatedAtLT    *time.Time  `json:"createdAtLT,omitempty"`
	CreatedAtLTE   *time.Time  `json:"createdAtLTE,omitempty"`

	// "updated_at" field predicates.
	UpdatedAt      *time.Time  `json:"updatedAt,omitempty"`
	UpdatedAtNEQ   *time.Time  `json:"updatedAtNEQ,omitempty"`
	UpdatedAtIn    []time.Time `json:"updatedAtIn,omitempty"`
	UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"`
	UpdatedAtGT    *time.Time  `json:"updatedAtGT,omitempty"`
	UpdatedAtGTE   *time.Time  `json:"updatedAtGTE,omitempty"`
	UpdatedAtLT    *time.Time  `json:"updatedAtLT,omitempty"`
	UpdatedAtLTE   *time.Time  `json:"updatedAtLTE,omitempty"`

	// "IP" field predicates.
	IP             *string  `json:"ip,omitempty"`
	IPNEQ          *string  `json:"ipNEQ,omitempty"`
	IPIn           []string `json:"ipIn,omitempty"`
	IPNotIn        []string `json:"ipNotIn,omitempty"`
	IPGT           *string  `json:"ipGT,omitempty"`
	IPGTE          *string  `json:"ipGTE,omitempty"`
	IPLT           *string  `json:"ipLT,omitempty"`
	IPLTE          *string  `json:"ipLTE,omitempty"`
	IPContains     *string  `json:"ipContains,omitempty"`
	IPHasPrefix    *string  `json:"ipHasPrefix,omitempty"`
	IPHasSuffix    *string  `json:"ipHasSuffix,omitempty"`
	IPEqualFold    *string  `json:"ipEqualFold,omitempty"`
	IPContainsFold *string  `json:"ipContainsFold,omitempty"`

	// "reserved" field predicates.
	Reserved    *bool `json:"reserved,omitempty"`
	ReservedNEQ *bool `json:"reservedNEQ,omitempty"`

	// "ip_block" edge predicates.
	HasIPBlock     *bool                `json:"hasIPBlock,omitempty"`
	HasIPBlockWith []*IPBlockWhereInput `json:"hasIPBlockWith,omitempty"`
}

IPAddressWhereInput represents a where input for filtering IPAddress queries.

func (*IPAddressWhereInput) AddPredicates

func (i *IPAddressWhereInput) AddPredicates(predicates ...predicate.IPAddress)

AddPredicates adds custom predicates to the where input to be used during the filtering phase.

func (*IPAddressWhereInput) Filter

Filter applies the IPAddressWhereInput filter on the IPAddressQuery builder.

func (*IPAddressWhereInput) P

P returns a predicate for filtering ipaddresses. An error is returned if the input is empty or invalid.

type IPAddresses

type IPAddresses []*IPAddress

IPAddresses is a parsable slice of IPAddress.

type IPBlock

type IPBlock struct {

	// ID of the ent.
	// The ID of the IP Block.
	ID gidx.PrefixedID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// The prefix of the ip block.
	Prefix string `json:"prefix,omitempty"`
	// The ID for the block type for this ip block.
	BlockTypeID gidx.PrefixedID `json:"block_type_id,omitempty"`
	// The ID for the location for this ip block.
	LocationID gidx.PrefixedID `json:"location_id,omitempty"`
	// The ID for the parent of this ip block.
	ParentBlockID gidx.PrefixedID `json:"parent_block_id,omitempty"`
	// Allow carving this block into smaller subnets.
	AllowAutoSubnet bool `json:"allow_auto_subnet,omitempty"`
	// Allow automatically assigning IPs directly from this block.
	AllowAutoAllocate bool `json:"allow_auto_allocate,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the IPBlockQuery when eager-loading is set.
	Edges IPBlockEdges `json:"edges"`
	// contains filtered or unexported fields
}

Represents an ip block node on the graph.

func (*IPBlock) IPAddress

func (ib *IPBlock) IPAddress(
	ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, orderBy *IPAddressOrder, where *IPAddressWhereInput,
) (*IPAddressConnection, error)

func (*IPBlock) IPBlockType

func (ib *IPBlock) IPBlockType(ctx context.Context) (*IPBlockType, error)

func (IPBlock) IsEntity

func (ib IPBlock) IsEntity()

IsEntity implement fedruntime.Entity

func (*IPBlock) IsNode

func (n *IPBlock) IsNode()

IsNode implements the Node interface check for GQLGen.

func (*IPBlock) NamedIPAddress

func (ib *IPBlock) NamedIPAddress(name string) ([]*IPAddress, error)

NamedIPAddress returns the IPAddress named value or an error if the edge was not loaded in eager-loading with this name.

func (*IPBlock) QueryIPAddress

func (ib *IPBlock) QueryIPAddress() *IPAddressQuery

QueryIPAddress queries the "ip_address" edge of the IPBlock entity.

func (*IPBlock) QueryIPBlockType

func (ib *IPBlock) QueryIPBlockType() *IPBlockTypeQuery

QueryIPBlockType queries the "ip_block_type" edge of the IPBlock entity.

func (*IPBlock) String

func (ib *IPBlock) String() string

String implements the fmt.Stringer.

func (*IPBlock) ToEdge

func (ib *IPBlock) ToEdge(order *IPBlockOrder) *IPBlockEdge

ToEdge converts IPBlock into IPBlockEdge.

func (*IPBlock) Unwrap

func (ib *IPBlock) Unwrap() *IPBlock

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

func (ib *IPBlock) Update() *IPBlockUpdateOne

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

func (*IPBlock) Value

func (ib *IPBlock) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the IPBlock. This includes values selected through modifiers, order, etc.

type IPBlockClient

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

IPBlockClient is a client for the IPBlock schema.

func NewIPBlockClient

func NewIPBlockClient(c config) *IPBlockClient

NewIPBlockClient returns a client for the IPBlock from the given config.

func (*IPBlockClient) Create

func (c *IPBlockClient) Create() *IPBlockCreate

Create returns a builder for creating a IPBlock entity.

func (*IPBlockClient) CreateBulk

func (c *IPBlockClient) CreateBulk(builders ...*IPBlockCreate) *IPBlockCreateBulk

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

func (*IPBlockClient) Delete

func (c *IPBlockClient) Delete() *IPBlockDelete

Delete returns a delete builder for IPBlock.

func (*IPBlockClient) DeleteOne

func (c *IPBlockClient) DeleteOne(ib *IPBlock) *IPBlockDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*IPBlockClient) DeleteOneID

func (c *IPBlockClient) DeleteOneID(id gidx.PrefixedID) *IPBlockDeleteOne

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

func (*IPBlockClient) Get

Get returns a IPBlock entity by its id.

func (*IPBlockClient) GetX

func (c *IPBlockClient) GetX(ctx context.Context, id gidx.PrefixedID) *IPBlock

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

func (*IPBlockClient) Hooks

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

Hooks returns the client hooks.

func (*IPBlockClient) Intercept

func (c *IPBlockClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `ipblock.Intercept(f(g(h())))`.

func (*IPBlockClient) Interceptors

func (c *IPBlockClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*IPBlockClient) MapCreateBulk added in v0.2.0

func (c *IPBlockClient) MapCreateBulk(slice any, setFunc func(*IPBlockCreate, int)) *IPBlockCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*IPBlockClient) Query

func (c *IPBlockClient) Query() *IPBlockQuery

Query returns a query builder for IPBlock.

func (*IPBlockClient) QueryIPAddress

func (c *IPBlockClient) QueryIPAddress(ib *IPBlock) *IPAddressQuery

QueryIPAddress queries the ip_address edge of a IPBlock.

func (*IPBlockClient) QueryIPBlockType

func (c *IPBlockClient) QueryIPBlockType(ib *IPBlock) *IPBlockTypeQuery

QueryIPBlockType queries the ip_block_type edge of a IPBlock.

func (*IPBlockClient) Update

func (c *IPBlockClient) Update() *IPBlockUpdate

Update returns an update builder for IPBlock.

func (*IPBlockClient) UpdateOne

func (c *IPBlockClient) UpdateOne(ib *IPBlock) *IPBlockUpdateOne

UpdateOne returns an update builder for the given entity.

func (*IPBlockClient) UpdateOneID

func (c *IPBlockClient) UpdateOneID(id gidx.PrefixedID) *IPBlockUpdateOne

UpdateOneID returns an update builder for the given id.

func (*IPBlockClient) Use

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

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

type IPBlockConnection

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

IPBlockConnection is the connection containing edges to IPBlock.

type IPBlockCreate

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

IPBlockCreate is the builder for creating a IPBlock entity.

func (*IPBlockCreate) AddIPAddresIDs

func (ibc *IPBlockCreate) AddIPAddresIDs(ids ...gidx.PrefixedID) *IPBlockCreate

AddIPAddresIDs adds the "ip_address" edge to the IPAddress entity by IDs.

func (*IPBlockCreate) AddIPAddress

func (ibc *IPBlockCreate) AddIPAddress(i ...*IPAddress) *IPBlockCreate

AddIPAddress adds the "ip_address" edges to the IPAddress entity.

func (*IPBlockCreate) Exec

func (ibc *IPBlockCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*IPBlockCreate) ExecX

func (ibc *IPBlockCreate) ExecX(ctx context.Context)

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

func (*IPBlockCreate) Mutation

func (ibc *IPBlockCreate) Mutation() *IPBlockMutation

Mutation returns the IPBlockMutation object of the builder.

func (*IPBlockCreate) Save

func (ibc *IPBlockCreate) Save(ctx context.Context) (*IPBlock, error)

Save creates the IPBlock in the database.

func (*IPBlockCreate) SaveX

func (ibc *IPBlockCreate) SaveX(ctx context.Context) *IPBlock

SaveX calls Save and panics if Save returns an error.

func (*IPBlockCreate) SetAllowAutoAllocate

func (ibc *IPBlockCreate) SetAllowAutoAllocate(b bool) *IPBlockCreate

SetAllowAutoAllocate sets the "allow_auto_allocate" field.

func (*IPBlockCreate) SetAllowAutoSubnet

func (ibc *IPBlockCreate) SetAllowAutoSubnet(b bool) *IPBlockCreate

SetAllowAutoSubnet sets the "allow_auto_subnet" field.

func (*IPBlockCreate) SetBlockTypeID

func (ibc *IPBlockCreate) SetBlockTypeID(gi gidx.PrefixedID) *IPBlockCreate

SetBlockTypeID sets the "block_type_id" field.

func (*IPBlockCreate) SetCreatedAt

func (ibc *IPBlockCreate) SetCreatedAt(t time.Time) *IPBlockCreate

SetCreatedAt sets the "created_at" field.

func (*IPBlockCreate) SetID

func (ibc *IPBlockCreate) SetID(gi gidx.PrefixedID) *IPBlockCreate

SetID sets the "id" field.

func (*IPBlockCreate) SetIPBlockType

func (ibc *IPBlockCreate) SetIPBlockType(i *IPBlockType) *IPBlockCreate

SetIPBlockType sets the "ip_block_type" edge to the IPBlockType entity.

func (*IPBlockCreate) SetIPBlockTypeID

func (ibc *IPBlockCreate) SetIPBlockTypeID(id gidx.PrefixedID) *IPBlockCreate

SetIPBlockTypeID sets the "ip_block_type" edge to the IPBlockType entity by ID.

func (*IPBlockCreate) SetInput

SetInput applies the change-set in the CreateIPBlockInput on the IPBlockCreate builder.

func (*IPBlockCreate) SetLocationID

func (ibc *IPBlockCreate) SetLocationID(gi gidx.PrefixedID) *IPBlockCreate

SetLocationID sets the "location_id" field.

func (*IPBlockCreate) SetNillableAllowAutoAllocate

func (ibc *IPBlockCreate) SetNillableAllowAutoAllocate(b *bool) *IPBlockCreate

SetNillableAllowAutoAllocate sets the "allow_auto_allocate" field if the given value is not nil.

func (*IPBlockCreate) SetNillableAllowAutoSubnet

func (ibc *IPBlockCreate) SetNillableAllowAutoSubnet(b *bool) *IPBlockCreate

SetNillableAllowAutoSubnet sets the "allow_auto_subnet" field if the given value is not nil.

func (*IPBlockCreate) SetNillableCreatedAt

func (ibc *IPBlockCreate) SetNillableCreatedAt(t *time.Time) *IPBlockCreate

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

func (*IPBlockCreate) SetNillableID

func (ibc *IPBlockCreate) SetNillableID(gi *gidx.PrefixedID) *IPBlockCreate

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

func (*IPBlockCreate) SetNillableUpdatedAt

func (ibc *IPBlockCreate) SetNillableUpdatedAt(t *time.Time) *IPBlockCreate

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

func (*IPBlockCreate) SetParentBlockID

func (ibc *IPBlockCreate) SetParentBlockID(gi gidx.PrefixedID) *IPBlockCreate

SetParentBlockID sets the "parent_block_id" field.

func (*IPBlockCreate) SetPrefix

func (ibc *IPBlockCreate) SetPrefix(s string) *IPBlockCreate

SetPrefix sets the "prefix" field.

func (*IPBlockCreate) SetUpdatedAt

func (ibc *IPBlockCreate) SetUpdatedAt(t time.Time) *IPBlockCreate

SetUpdatedAt sets the "updated_at" field.

type IPBlockCreateBulk

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

IPBlockCreateBulk is the builder for creating many IPBlock entities in bulk.

func (*IPBlockCreateBulk) Exec

func (ibcb *IPBlockCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*IPBlockCreateBulk) ExecX

func (ibcb *IPBlockCreateBulk) ExecX(ctx context.Context)

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

func (*IPBlockCreateBulk) Save

func (ibcb *IPBlockCreateBulk) Save(ctx context.Context) ([]*IPBlock, error)

Save creates the IPBlock entities in the database.

func (*IPBlockCreateBulk) SaveX

func (ibcb *IPBlockCreateBulk) SaveX(ctx context.Context) []*IPBlock

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

type IPBlockDelete

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

IPBlockDelete is the builder for deleting a IPBlock entity.

func (*IPBlockDelete) Exec

func (ibd *IPBlockDelete) Exec(ctx context.Context) (int, error)

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

func (*IPBlockDelete) ExecX

func (ibd *IPBlockDelete) ExecX(ctx context.Context) int

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

func (*IPBlockDelete) Where

func (ibd *IPBlockDelete) Where(ps ...predicate.IPBlock) *IPBlockDelete

Where appends a list predicates to the IPBlockDelete builder.

type IPBlockDeleteOne

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

IPBlockDeleteOne is the builder for deleting a single IPBlock entity.

func (*IPBlockDeleteOne) Exec

func (ibdo *IPBlockDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*IPBlockDeleteOne) ExecX

func (ibdo *IPBlockDeleteOne) ExecX(ctx context.Context)

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

func (*IPBlockDeleteOne) Where

func (ibdo *IPBlockDeleteOne) Where(ps ...predicate.IPBlock) *IPBlockDeleteOne

Where appends a list predicates to the IPBlockDelete builder.

type IPBlockEdge

type IPBlockEdge struct {
	Node   *IPBlock `json:"node"`
	Cursor Cursor   `json:"cursor"`
}

IPBlockEdge is the edge representation of IPBlock.

type IPBlockEdges

type IPBlockEdges struct {
	// IPBlockType holds the value of the ip_block_type edge.
	IPBlockType *IPBlockType `json:"ip_block_type,omitempty"`
	// IPAddress holds the value of the ip_address edge.
	IPAddress []*IPAddress `json:"ip_address,omitempty"`
	// contains filtered or unexported fields
}

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

func (IPBlockEdges) IPAddressOrErr

func (e IPBlockEdges) IPAddressOrErr() ([]*IPAddress, error)

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

func (IPBlockEdges) IPBlockTypeOrErr

func (e IPBlockEdges) IPBlockTypeOrErr() (*IPBlockType, error)

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

type IPBlockGroupBy

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

IPBlockGroupBy is the group-by builder for IPBlock entities.

func (*IPBlockGroupBy) Aggregate

func (ibgb *IPBlockGroupBy) Aggregate(fns ...AggregateFunc) *IPBlockGroupBy

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

func (*IPBlockGroupBy) Bool

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

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

func (*IPBlockGroupBy) BoolX

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

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

func (*IPBlockGroupBy) Bools

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

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

func (*IPBlockGroupBy) BoolsX

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

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

func (*IPBlockGroupBy) Float64

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

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

func (*IPBlockGroupBy) Float64X

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

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

func (*IPBlockGroupBy) Float64s

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

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

func (*IPBlockGroupBy) Float64sX

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

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

func (*IPBlockGroupBy) Int

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

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

func (*IPBlockGroupBy) IntX

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

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

func (*IPBlockGroupBy) Ints

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

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

func (*IPBlockGroupBy) IntsX

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

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

func (*IPBlockGroupBy) Scan

func (ibgb *IPBlockGroupBy) Scan(ctx context.Context, v any) error

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

func (*IPBlockGroupBy) ScanX

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

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

func (*IPBlockGroupBy) String

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

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

func (*IPBlockGroupBy) StringX

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

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

func (*IPBlockGroupBy) Strings

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

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

func (*IPBlockGroupBy) StringsX

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

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

type IPBlockMutation

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

IPBlockMutation represents an operation that mutates the IPBlock nodes in the graph.

func (*IPBlockMutation) AddField

func (m *IPBlockMutation) 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 (*IPBlockMutation) AddIPAddresIDs

func (m *IPBlockMutation) AddIPAddresIDs(ids ...gidx.PrefixedID)

AddIPAddresIDs adds the "ip_address" edge to the IPAddress entity by ids.

func (*IPBlockMutation) AddedEdges

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

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

func (*IPBlockMutation) AddedField

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

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

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

func (*IPBlockMutation) AddedIDs

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

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

func (*IPBlockMutation) AllowAutoAllocate

func (m *IPBlockMutation) AllowAutoAllocate() (r bool, exists bool)

AllowAutoAllocate returns the value of the "allow_auto_allocate" field in the mutation.

func (*IPBlockMutation) AllowAutoSubnet

func (m *IPBlockMutation) AllowAutoSubnet() (r bool, exists bool)

AllowAutoSubnet returns the value of the "allow_auto_subnet" field in the mutation.

func (*IPBlockMutation) BlockTypeID

func (m *IPBlockMutation) BlockTypeID() (r gidx.PrefixedID, exists bool)

BlockTypeID returns the value of the "block_type_id" field in the mutation.

func (*IPBlockMutation) ClearEdge

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

func (m *IPBlockMutation) 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 (*IPBlockMutation) ClearIPAddress

func (m *IPBlockMutation) ClearIPAddress()

ClearIPAddress clears the "ip_address" edge to the IPAddress entity.

func (*IPBlockMutation) ClearIPBlockType

func (m *IPBlockMutation) ClearIPBlockType()

ClearIPBlockType clears the "ip_block_type" edge to the IPBlockType entity.

func (*IPBlockMutation) ClearedEdges

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

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

func (*IPBlockMutation) ClearedFields

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

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

func (IPBlockMutation) Client

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

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

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

func (*IPBlockMutation) EdgeCleared

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

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

func (*IPBlockMutation) Field

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

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

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

func (*IPBlockMutation) Fields

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

func (m *IPBlockMutation) ID() (id gidx.PrefixedID, exists bool)

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

func (*IPBlockMutation) IDs

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

func (*IPBlockMutation) IPAddressCleared

func (m *IPBlockMutation) IPAddressCleared() bool

IPAddressCleared reports if the "ip_address" edge to the IPAddress entity was cleared.

func (*IPBlockMutation) IPAddressIDs

func (m *IPBlockMutation) IPAddressIDs() (ids []gidx.PrefixedID)

IPAddressIDs returns the "ip_address" edge IDs in the mutation.

func (*IPBlockMutation) IPBlockTypeCleared

func (m *IPBlockMutation) IPBlockTypeCleared() bool

IPBlockTypeCleared reports if the "ip_block_type" edge to the IPBlockType entity was cleared.

func (*IPBlockMutation) IPBlockTypeID

func (m *IPBlockMutation) IPBlockTypeID() (id gidx.PrefixedID, exists bool)

IPBlockTypeID returns the "ip_block_type" edge ID in the mutation.

func (*IPBlockMutation) IPBlockTypeIDs

func (m *IPBlockMutation) IPBlockTypeIDs() (ids []gidx.PrefixedID)

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

func (*IPBlockMutation) LocationID

func (m *IPBlockMutation) LocationID() (r gidx.PrefixedID, exists bool)

LocationID returns the value of the "location_id" field in the mutation.

func (*IPBlockMutation) OldAllowAutoAllocate

func (m *IPBlockMutation) OldAllowAutoAllocate(ctx context.Context) (v bool, err error)

OldAllowAutoAllocate returns the old "allow_auto_allocate" field's value of the IPBlock entity. If the IPBlock 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 (*IPBlockMutation) OldAllowAutoSubnet

func (m *IPBlockMutation) OldAllowAutoSubnet(ctx context.Context) (v bool, err error)

OldAllowAutoSubnet returns the old "allow_auto_subnet" field's value of the IPBlock entity. If the IPBlock 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 (*IPBlockMutation) OldBlockTypeID

func (m *IPBlockMutation) OldBlockTypeID(ctx context.Context) (v gidx.PrefixedID, err error)

OldBlockTypeID returns the old "block_type_id" field's value of the IPBlock entity. If the IPBlock 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 (*IPBlockMutation) OldCreatedAt

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

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

func (m *IPBlockMutation) 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 (*IPBlockMutation) OldLocationID

func (m *IPBlockMutation) OldLocationID(ctx context.Context) (v gidx.PrefixedID, err error)

OldLocationID returns the old "location_id" field's value of the IPBlock entity. If the IPBlock 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 (*IPBlockMutation) OldParentBlockID

func (m *IPBlockMutation) OldParentBlockID(ctx context.Context) (v gidx.PrefixedID, err error)

OldParentBlockID returns the old "parent_block_id" field's value of the IPBlock entity. If the IPBlock 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 (*IPBlockMutation) OldPrefix

func (m *IPBlockMutation) OldPrefix(ctx context.Context) (v string, err error)

OldPrefix returns the old "prefix" field's value of the IPBlock entity. If the IPBlock 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 (*IPBlockMutation) OldUpdatedAt

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

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

func (m *IPBlockMutation) Op() Op

Op returns the operation name.

func (*IPBlockMutation) ParentBlockID

func (m *IPBlockMutation) ParentBlockID() (r gidx.PrefixedID, exists bool)

ParentBlockID returns the value of the "parent_block_id" field in the mutation.

func (*IPBlockMutation) Prefix

func (m *IPBlockMutation) Prefix() (r string, exists bool)

Prefix returns the value of the "prefix" field in the mutation.

func (*IPBlockMutation) RemoveIPAddresIDs

func (m *IPBlockMutation) RemoveIPAddresIDs(ids ...gidx.PrefixedID)

RemoveIPAddresIDs removes the "ip_address" edge to the IPAddress entity by IDs.

func (*IPBlockMutation) RemovedEdges

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

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

func (*IPBlockMutation) RemovedIDs

func (m *IPBlockMutation) 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 (*IPBlockMutation) RemovedIPAddressIDs

func (m *IPBlockMutation) RemovedIPAddressIDs() (ids []gidx.PrefixedID)

RemovedIPAddress returns the removed IDs of the "ip_address" edge to the IPAddress entity.

func (*IPBlockMutation) ResetAllowAutoAllocate

func (m *IPBlockMutation) ResetAllowAutoAllocate()

ResetAllowAutoAllocate resets all changes to the "allow_auto_allocate" field.

func (*IPBlockMutation) ResetAllowAutoSubnet

func (m *IPBlockMutation) ResetAllowAutoSubnet()

ResetAllowAutoSubnet resets all changes to the "allow_auto_subnet" field.

func (*IPBlockMutation) ResetBlockTypeID

func (m *IPBlockMutation) ResetBlockTypeID()

ResetBlockTypeID resets all changes to the "block_type_id" field.

func (*IPBlockMutation) ResetCreatedAt

func (m *IPBlockMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*IPBlockMutation) ResetEdge

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

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

func (m *IPBlockMutation) ResetIPAddress()

ResetIPAddress resets all changes to the "ip_address" edge.

func (*IPBlockMutation) ResetIPBlockType

func (m *IPBlockMutation) ResetIPBlockType()

ResetIPBlockType resets all changes to the "ip_block_type" edge.

func (*IPBlockMutation) ResetLocationID

func (m *IPBlockMutation) ResetLocationID()

ResetLocationID resets all changes to the "location_id" field.

func (*IPBlockMutation) ResetParentBlockID

func (m *IPBlockMutation) ResetParentBlockID()

ResetParentBlockID resets all changes to the "parent_block_id" field.

func (*IPBlockMutation) ResetPrefix

func (m *IPBlockMutation) ResetPrefix()

ResetPrefix resets all changes to the "prefix" field.

func (*IPBlockMutation) ResetUpdatedAt

func (m *IPBlockMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*IPBlockMutation) SetAllowAutoAllocate

func (m *IPBlockMutation) SetAllowAutoAllocate(b bool)

SetAllowAutoAllocate sets the "allow_auto_allocate" field.

func (*IPBlockMutation) SetAllowAutoSubnet

func (m *IPBlockMutation) SetAllowAutoSubnet(b bool)

SetAllowAutoSubnet sets the "allow_auto_subnet" field.

func (*IPBlockMutation) SetBlockTypeID

func (m *IPBlockMutation) SetBlockTypeID(gi gidx.PrefixedID)

SetBlockTypeID sets the "block_type_id" field.

func (*IPBlockMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*IPBlockMutation) SetField

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

func (m *IPBlockMutation) SetID(id gidx.PrefixedID)

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

func (*IPBlockMutation) SetIPBlockTypeID

func (m *IPBlockMutation) SetIPBlockTypeID(id gidx.PrefixedID)

SetIPBlockTypeID sets the "ip_block_type" edge to the IPBlockType entity by id.

func (*IPBlockMutation) SetLocationID

func (m *IPBlockMutation) SetLocationID(gi gidx.PrefixedID)

SetLocationID sets the "location_id" field.

func (*IPBlockMutation) SetOp

func (m *IPBlockMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*IPBlockMutation) SetParentBlockID

func (m *IPBlockMutation) SetParentBlockID(gi gidx.PrefixedID)

SetParentBlockID sets the "parent_block_id" field.

func (*IPBlockMutation) SetPrefix

func (m *IPBlockMutation) SetPrefix(s string)

SetPrefix sets the "prefix" field.

func (*IPBlockMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (IPBlockMutation) Tx

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

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

func (*IPBlockMutation) Type

func (m *IPBlockMutation) Type() string

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

func (*IPBlockMutation) UpdatedAt

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

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

func (*IPBlockMutation) Where

func (m *IPBlockMutation) Where(ps ...predicate.IPBlock)

Where appends a list predicates to the IPBlockMutation builder.

func (*IPBlockMutation) WhereP

func (m *IPBlockMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the IPBlockMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type IPBlockOrder

type IPBlockOrder struct {
	Direction OrderDirection     `json:"direction"`
	Field     *IPBlockOrderField `json:"field"`
}

IPBlockOrder defines the ordering of IPBlock.

type IPBlockOrderField

type IPBlockOrderField struct {
	// Value extracts the ordering value from the given IPBlock.
	Value func(*IPBlock) (ent.Value, error)
	// contains filtered or unexported fields
}

IPBlockOrderField defines the ordering field of IPBlock.

func (IPBlockOrderField) MarshalGQL

func (f IPBlockOrderField) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (IPBlockOrderField) String

func (f IPBlockOrderField) String() string

String implement fmt.Stringer interface.

func (*IPBlockOrderField) UnmarshalGQL

func (f *IPBlockOrderField) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

type IPBlockPaginateOption

type IPBlockPaginateOption func(*ipblockPager) error

IPBlockPaginateOption enables pagination customization.

func WithIPBlockFilter

func WithIPBlockFilter(filter func(*IPBlockQuery) (*IPBlockQuery, error)) IPBlockPaginateOption

WithIPBlockFilter configures pagination filter.

func WithIPBlockOrder

func WithIPBlockOrder(order *IPBlockOrder) IPBlockPaginateOption

WithIPBlockOrder configures pagination ordering.

type IPBlockQuery

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

IPBlockQuery is the builder for querying IPBlock entities.

func (*IPBlockQuery) Aggregate

func (ibq *IPBlockQuery) Aggregate(fns ...AggregateFunc) *IPBlockSelect

Aggregate returns a IPBlockSelect configured with the given aggregations.

func (*IPBlockQuery) All

func (ibq *IPBlockQuery) All(ctx context.Context) ([]*IPBlock, error)

All executes the query and returns a list of IPBlocks.

func (*IPBlockQuery) AllX

func (ibq *IPBlockQuery) AllX(ctx context.Context) []*IPBlock

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

func (*IPBlockQuery) Clone

func (ibq *IPBlockQuery) Clone() *IPBlockQuery

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

func (*IPBlockQuery) CollectFields

func (ib *IPBlockQuery) CollectFields(ctx context.Context, satisfies ...string) (*IPBlockQuery, error)

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

func (*IPBlockQuery) Count

func (ibq *IPBlockQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*IPBlockQuery) CountX

func (ibq *IPBlockQuery) CountX(ctx context.Context) int

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

func (*IPBlockQuery) Exist

func (ibq *IPBlockQuery) Exist(ctx context.Context) (bool, error)

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

func (*IPBlockQuery) ExistX

func (ibq *IPBlockQuery) ExistX(ctx context.Context) bool

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

func (*IPBlockQuery) First

func (ibq *IPBlockQuery) First(ctx context.Context) (*IPBlock, error)

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

func (*IPBlockQuery) FirstID

func (ibq *IPBlockQuery) FirstID(ctx context.Context) (id gidx.PrefixedID, err error)

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

func (*IPBlockQuery) FirstIDX

func (ibq *IPBlockQuery) FirstIDX(ctx context.Context) gidx.PrefixedID

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

func (*IPBlockQuery) FirstX

func (ibq *IPBlockQuery) FirstX(ctx context.Context) *IPBlock

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

func (*IPBlockQuery) GroupBy

func (ibq *IPBlockQuery) GroupBy(field string, fields ...string) *IPBlockGroupBy

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

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.IPBlock.Query().
	GroupBy(ipblock.FieldCreatedAt).
	Aggregate(generated.Count()).
	Scan(ctx, &v)

func (*IPBlockQuery) IDs

func (ibq *IPBlockQuery) IDs(ctx context.Context) (ids []gidx.PrefixedID, err error)

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

func (*IPBlockQuery) IDsX

func (ibq *IPBlockQuery) IDsX(ctx context.Context) []gidx.PrefixedID

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

func (*IPBlockQuery) Limit

func (ibq *IPBlockQuery) Limit(limit int) *IPBlockQuery

Limit the number of records to be returned by this query.

func (*IPBlockQuery) Offset

func (ibq *IPBlockQuery) Offset(offset int) *IPBlockQuery

Offset to start from.

func (*IPBlockQuery) Only

func (ibq *IPBlockQuery) Only(ctx context.Context) (*IPBlock, error)

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

func (*IPBlockQuery) OnlyID

func (ibq *IPBlockQuery) OnlyID(ctx context.Context) (id gidx.PrefixedID, err error)

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

func (*IPBlockQuery) OnlyIDX

func (ibq *IPBlockQuery) OnlyIDX(ctx context.Context) gidx.PrefixedID

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

func (*IPBlockQuery) OnlyX

func (ibq *IPBlockQuery) OnlyX(ctx context.Context) *IPBlock

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

func (*IPBlockQuery) Order

func (ibq *IPBlockQuery) Order(o ...ipblock.OrderOption) *IPBlockQuery

Order specifies how the records should be ordered.

func (*IPBlockQuery) Paginate

func (ib *IPBlockQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...IPBlockPaginateOption,
) (*IPBlockConnection, error)

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

func (*IPBlockQuery) QueryIPAddress

func (ibq *IPBlockQuery) QueryIPAddress() *IPAddressQuery

QueryIPAddress chains the current query on the "ip_address" edge.

func (*IPBlockQuery) QueryIPBlockType

func (ibq *IPBlockQuery) QueryIPBlockType() *IPBlockTypeQuery

QueryIPBlockType chains the current query on the "ip_block_type" edge.

func (*IPBlockQuery) Select

func (ibq *IPBlockQuery) Select(fields ...string) *IPBlockSelect

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

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.IPBlock.Query().
	Select(ipblock.FieldCreatedAt).
	Scan(ctx, &v)

func (*IPBlockQuery) Unique

func (ibq *IPBlockQuery) Unique(unique bool) *IPBlockQuery

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

func (ibq *IPBlockQuery) Where(ps ...predicate.IPBlock) *IPBlockQuery

Where adds a new predicate for the IPBlockQuery builder.

func (*IPBlockQuery) WithIPAddress

func (ibq *IPBlockQuery) WithIPAddress(opts ...func(*IPAddressQuery)) *IPBlockQuery

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

func (*IPBlockQuery) WithIPBlockType

func (ibq *IPBlockQuery) WithIPBlockType(opts ...func(*IPBlockTypeQuery)) *IPBlockQuery

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

func (*IPBlockQuery) WithNamedIPAddress

func (ibq *IPBlockQuery) WithNamedIPAddress(name string, opts ...func(*IPAddressQuery)) *IPBlockQuery

WithNamedIPAddress tells the query-builder to eager-load the nodes that are connected to the "ip_address" edge with the given name. The optional arguments are used to configure the query builder of the edge.

type IPBlockSelect

type IPBlockSelect struct {
	*IPBlockQuery
	// contains filtered or unexported fields
}

IPBlockSelect is the builder for selecting fields of IPBlock entities.

func (*IPBlockSelect) Aggregate

func (ibs *IPBlockSelect) Aggregate(fns ...AggregateFunc) *IPBlockSelect

Aggregate adds the given aggregation functions to the selector query.

func (*IPBlockSelect) Bool

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

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

func (*IPBlockSelect) BoolX

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

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

func (*IPBlockSelect) Bools

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

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

func (*IPBlockSelect) BoolsX

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

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

func (*IPBlockSelect) Float64

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

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

func (*IPBlockSelect) Float64X

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

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

func (*IPBlockSelect) Float64s

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

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

func (*IPBlockSelect) Float64sX

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

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

func (*IPBlockSelect) Int

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

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

func (*IPBlockSelect) IntX

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

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

func (*IPBlockSelect) Ints

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

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

func (*IPBlockSelect) IntsX

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

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

func (*IPBlockSelect) Scan

func (ibs *IPBlockSelect) Scan(ctx context.Context, v any) error

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

func (*IPBlockSelect) ScanX

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

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

func (*IPBlockSelect) String

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

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

func (*IPBlockSelect) StringX

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

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

func (*IPBlockSelect) Strings

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

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

func (*IPBlockSelect) StringsX

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

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

type IPBlockType

type IPBlockType struct {

	// ID of the ent.
	// The ID of the IP Block Type.
	ID gidx.PrefixedID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// The name of the ip block type.
	Name string `json:"name,omitempty"`
	// The ID for the owner for this ip block type.
	OwnerID gidx.PrefixedID `json:"owner_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the IPBlockTypeQuery when eager-loading is set.
	Edges IPBlockTypeEdges `json:"edges"`
	// contains filtered or unexported fields
}

Represents an ip block type node on the graph.

func (*IPBlockType) IPBlock

func (ibt *IPBlockType) IPBlock(
	ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, orderBy *IPBlockOrder, where *IPBlockWhereInput,
) (*IPBlockConnection, error)

func (IPBlockType) IsEntity

func (ibt IPBlockType) IsEntity()

IsEntity implement fedruntime.Entity

func (*IPBlockType) IsNode

func (n *IPBlockType) IsNode()

IsNode implements the Node interface check for GQLGen.

func (*IPBlockType) NamedIPBlock

func (ibt *IPBlockType) NamedIPBlock(name string) ([]*IPBlock, error)

NamedIPBlock returns the IPBlock named value or an error if the edge was not loaded in eager-loading with this name.

func (*IPBlockType) QueryIPBlock

func (ibt *IPBlockType) QueryIPBlock() *IPBlockQuery

QueryIPBlock queries the "ip_block" edge of the IPBlockType entity.

func (*IPBlockType) String

func (ibt *IPBlockType) String() string

String implements the fmt.Stringer.

func (*IPBlockType) ToEdge

func (ibt *IPBlockType) ToEdge(order *IPBlockTypeOrder) *IPBlockTypeEdge

ToEdge converts IPBlockType into IPBlockTypeEdge.

func (*IPBlockType) Unwrap

func (ibt *IPBlockType) Unwrap() *IPBlockType

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

func (ibt *IPBlockType) Update() *IPBlockTypeUpdateOne

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

func (*IPBlockType) Value

func (ibt *IPBlockType) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the IPBlockType. This includes values selected through modifiers, order, etc.

type IPBlockTypeClient

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

IPBlockTypeClient is a client for the IPBlockType schema.

func NewIPBlockTypeClient

func NewIPBlockTypeClient(c config) *IPBlockTypeClient

NewIPBlockTypeClient returns a client for the IPBlockType from the given config.

func (*IPBlockTypeClient) Create

func (c *IPBlockTypeClient) Create() *IPBlockTypeCreate

Create returns a builder for creating a IPBlockType entity.

func (*IPBlockTypeClient) CreateBulk

func (c *IPBlockTypeClient) CreateBulk(builders ...*IPBlockTypeCreate) *IPBlockTypeCreateBulk

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

func (*IPBlockTypeClient) Delete

func (c *IPBlockTypeClient) Delete() *IPBlockTypeDelete

Delete returns a delete builder for IPBlockType.

func (*IPBlockTypeClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*IPBlockTypeClient) DeleteOneID

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

func (*IPBlockTypeClient) Get

Get returns a IPBlockType entity by its id.

func (*IPBlockTypeClient) GetX

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

func (*IPBlockTypeClient) Hooks

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

Hooks returns the client hooks.

func (*IPBlockTypeClient) Intercept

func (c *IPBlockTypeClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `ipblocktype.Intercept(f(g(h())))`.

func (*IPBlockTypeClient) Interceptors

func (c *IPBlockTypeClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*IPBlockTypeClient) MapCreateBulk added in v0.2.0

func (c *IPBlockTypeClient) MapCreateBulk(slice any, setFunc func(*IPBlockTypeCreate, int)) *IPBlockTypeCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*IPBlockTypeClient) Query

func (c *IPBlockTypeClient) Query() *IPBlockTypeQuery

Query returns a query builder for IPBlockType.

func (*IPBlockTypeClient) QueryIPBlock

func (c *IPBlockTypeClient) QueryIPBlock(ibt *IPBlockType) *IPBlockQuery

QueryIPBlock queries the ip_block edge of a IPBlockType.

func (*IPBlockTypeClient) Update

func (c *IPBlockTypeClient) Update() *IPBlockTypeUpdate

Update returns an update builder for IPBlockType.

func (*IPBlockTypeClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*IPBlockTypeClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*IPBlockTypeClient) Use

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

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

type IPBlockTypeConnection

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

IPBlockTypeConnection is the connection containing edges to IPBlockType.

type IPBlockTypeCreate

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

IPBlockTypeCreate is the builder for creating a IPBlockType entity.

func (*IPBlockTypeCreate) AddIPBlock

func (ibtc *IPBlockTypeCreate) AddIPBlock(i ...*IPBlock) *IPBlockTypeCreate

AddIPBlock adds the "ip_block" edges to the IPBlock entity.

func (*IPBlockTypeCreate) AddIPBlockIDs

func (ibtc *IPBlockTypeCreate) AddIPBlockIDs(ids ...gidx.PrefixedID) *IPBlockTypeCreate

AddIPBlockIDs adds the "ip_block" edge to the IPBlock entity by IDs.

func (*IPBlockTypeCreate) Exec

func (ibtc *IPBlockTypeCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*IPBlockTypeCreate) ExecX

func (ibtc *IPBlockTypeCreate) ExecX(ctx context.Context)

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

func (*IPBlockTypeCreate) Mutation

func (ibtc *IPBlockTypeCreate) Mutation() *IPBlockTypeMutation

Mutation returns the IPBlockTypeMutation object of the builder.

func (*IPBlockTypeCreate) Save

func (ibtc *IPBlockTypeCreate) Save(ctx context.Context) (*IPBlockType, error)

Save creates the IPBlockType in the database.

func (*IPBlockTypeCreate) SaveX

func (ibtc *IPBlockTypeCreate) SaveX(ctx context.Context) *IPBlockType

SaveX calls Save and panics if Save returns an error.

func (*IPBlockTypeCreate) SetCreatedAt

func (ibtc *IPBlockTypeCreate) SetCreatedAt(t time.Time) *IPBlockTypeCreate

SetCreatedAt sets the "created_at" field.

func (*IPBlockTypeCreate) SetID

SetID sets the "id" field.

func (*IPBlockTypeCreate) SetInput

SetInput applies the change-set in the CreateIPBlockTypeInput on the IPBlockTypeCreate builder.

func (*IPBlockTypeCreate) SetName

func (ibtc *IPBlockTypeCreate) SetName(s string) *IPBlockTypeCreate

SetName sets the "name" field.

func (*IPBlockTypeCreate) SetNillableCreatedAt

func (ibtc *IPBlockTypeCreate) SetNillableCreatedAt(t *time.Time) *IPBlockTypeCreate

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

func (*IPBlockTypeCreate) SetNillableID

func (ibtc *IPBlockTypeCreate) SetNillableID(gi *gidx.PrefixedID) *IPBlockTypeCreate

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

func (*IPBlockTypeCreate) SetNillableUpdatedAt

func (ibtc *IPBlockTypeCreate) SetNillableUpdatedAt(t *time.Time) *IPBlockTypeCreate

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

func (*IPBlockTypeCreate) SetOwnerID

func (ibtc *IPBlockTypeCreate) SetOwnerID(gi gidx.PrefixedID) *IPBlockTypeCreate

SetOwnerID sets the "owner_id" field.

func (*IPBlockTypeCreate) SetUpdatedAt

func (ibtc *IPBlockTypeCreate) SetUpdatedAt(t time.Time) *IPBlockTypeCreate

SetUpdatedAt sets the "updated_at" field.

type IPBlockTypeCreateBulk

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

IPBlockTypeCreateBulk is the builder for creating many IPBlockType entities in bulk.

func (*IPBlockTypeCreateBulk) Exec

func (ibtcb *IPBlockTypeCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*IPBlockTypeCreateBulk) ExecX

func (ibtcb *IPBlockTypeCreateBulk) ExecX(ctx context.Context)

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

func (*IPBlockTypeCreateBulk) Save

func (ibtcb *IPBlockTypeCreateBulk) Save(ctx context.Context) ([]*IPBlockType, error)

Save creates the IPBlockType entities in the database.

func (*IPBlockTypeCreateBulk) SaveX

func (ibtcb *IPBlockTypeCreateBulk) SaveX(ctx context.Context) []*IPBlockType

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

type IPBlockTypeDelete

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

IPBlockTypeDelete is the builder for deleting a IPBlockType entity.

func (*IPBlockTypeDelete) Exec

func (ibtd *IPBlockTypeDelete) Exec(ctx context.Context) (int, error)

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

func (*IPBlockTypeDelete) ExecX

func (ibtd *IPBlockTypeDelete) ExecX(ctx context.Context) int

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

func (*IPBlockTypeDelete) Where

Where appends a list predicates to the IPBlockTypeDelete builder.

type IPBlockTypeDeleteOne

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

IPBlockTypeDeleteOne is the builder for deleting a single IPBlockType entity.

func (*IPBlockTypeDeleteOne) Exec

func (ibtdo *IPBlockTypeDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*IPBlockTypeDeleteOne) ExecX

func (ibtdo *IPBlockTypeDeleteOne) ExecX(ctx context.Context)

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

func (*IPBlockTypeDeleteOne) Where

Where appends a list predicates to the IPBlockTypeDelete builder.

type IPBlockTypeEdge

type IPBlockTypeEdge struct {
	Node   *IPBlockType `json:"node"`
	Cursor Cursor       `json:"cursor"`
}

IPBlockTypeEdge is the edge representation of IPBlockType.

type IPBlockTypeEdges

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

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

func (IPBlockTypeEdges) IPBlockOrErr

func (e IPBlockTypeEdges) IPBlockOrErr() ([]*IPBlock, error)

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

type IPBlockTypeGroupBy

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

IPBlockTypeGroupBy is the group-by builder for IPBlockType entities.

func (*IPBlockTypeGroupBy) Aggregate

func (ibtgb *IPBlockTypeGroupBy) Aggregate(fns ...AggregateFunc) *IPBlockTypeGroupBy

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

func (*IPBlockTypeGroupBy) Bool

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

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

func (*IPBlockTypeGroupBy) BoolX

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

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

func (*IPBlockTypeGroupBy) Bools

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

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

func (*IPBlockTypeGroupBy) BoolsX

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

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

func (*IPBlockTypeGroupBy) Float64

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

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

func (*IPBlockTypeGroupBy) Float64X

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

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

func (*IPBlockTypeGroupBy) Float64s

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

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

func (*IPBlockTypeGroupBy) Float64sX

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

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

func (*IPBlockTypeGroupBy) Int

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

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

func (*IPBlockTypeGroupBy) IntX

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

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

func (*IPBlockTypeGroupBy) Ints

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

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

func (*IPBlockTypeGroupBy) IntsX

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

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

func (*IPBlockTypeGroupBy) Scan

func (ibtgb *IPBlockTypeGroupBy) Scan(ctx context.Context, v any) error

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

func (*IPBlockTypeGroupBy) ScanX

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

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

func (*IPBlockTypeGroupBy) String

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

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

func (*IPBlockTypeGroupBy) StringX

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

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

func (*IPBlockTypeGroupBy) Strings

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

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

func (*IPBlockTypeGroupBy) StringsX

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

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

type IPBlockTypeMutation

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

IPBlockTypeMutation represents an operation that mutates the IPBlockType nodes in the graph.

func (*IPBlockTypeMutation) AddField

func (m *IPBlockTypeMutation) 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 (*IPBlockTypeMutation) AddIPBlockIDs

func (m *IPBlockTypeMutation) AddIPBlockIDs(ids ...gidx.PrefixedID)

AddIPBlockIDs adds the "ip_block" edge to the IPBlock entity by ids.

func (*IPBlockTypeMutation) AddedEdges

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

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

func (*IPBlockTypeMutation) AddedField

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

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

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

func (*IPBlockTypeMutation) AddedIDs

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

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

func (*IPBlockTypeMutation) ClearEdge

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

func (m *IPBlockTypeMutation) 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 (*IPBlockTypeMutation) ClearIPBlock

func (m *IPBlockTypeMutation) ClearIPBlock()

ClearIPBlock clears the "ip_block" edge to the IPBlock entity.

func (*IPBlockTypeMutation) ClearedEdges

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

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

func (*IPBlockTypeMutation) ClearedFields

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

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

func (IPBlockTypeMutation) Client

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

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

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

func (*IPBlockTypeMutation) EdgeCleared

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

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

func (*IPBlockTypeMutation) Field

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

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

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

func (*IPBlockTypeMutation) Fields

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

func (m *IPBlockTypeMutation) ID() (id gidx.PrefixedID, exists bool)

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

func (*IPBlockTypeMutation) IDs

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

func (*IPBlockTypeMutation) IPBlockCleared

func (m *IPBlockTypeMutation) IPBlockCleared() bool

IPBlockCleared reports if the "ip_block" edge to the IPBlock entity was cleared.

func (*IPBlockTypeMutation) IPBlockIDs

func (m *IPBlockTypeMutation) IPBlockIDs() (ids []gidx.PrefixedID)

IPBlockIDs returns the "ip_block" edge IDs in the mutation.

func (*IPBlockTypeMutation) Name

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

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

func (*IPBlockTypeMutation) OldCreatedAt

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

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

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

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

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

func (m *IPBlockTypeMutation) OldOwnerID(ctx context.Context) (v gidx.PrefixedID, err error)

OldOwnerID returns the old "owner_id" field's value of the IPBlockType entity. If the IPBlockType 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 (*IPBlockTypeMutation) OldUpdatedAt

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

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

func (m *IPBlockTypeMutation) Op() Op

Op returns the operation name.

func (*IPBlockTypeMutation) OwnerID

func (m *IPBlockTypeMutation) OwnerID() (r gidx.PrefixedID, exists bool)

OwnerID returns the value of the "owner_id" field in the mutation.

func (*IPBlockTypeMutation) RemoveIPBlockIDs

func (m *IPBlockTypeMutation) RemoveIPBlockIDs(ids ...gidx.PrefixedID)

RemoveIPBlockIDs removes the "ip_block" edge to the IPBlock entity by IDs.

func (*IPBlockTypeMutation) RemovedEdges

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

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

func (*IPBlockTypeMutation) RemovedIDs

func (m *IPBlockTypeMutation) 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 (*IPBlockTypeMutation) RemovedIPBlockIDs

func (m *IPBlockTypeMutation) RemovedIPBlockIDs() (ids []gidx.PrefixedID)

RemovedIPBlock returns the removed IDs of the "ip_block" edge to the IPBlock entity.

func (*IPBlockTypeMutation) ResetCreatedAt

func (m *IPBlockTypeMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*IPBlockTypeMutation) ResetEdge

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

func (m *IPBlockTypeMutation) 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 (*IPBlockTypeMutation) ResetIPBlock

func (m *IPBlockTypeMutation) ResetIPBlock()

ResetIPBlock resets all changes to the "ip_block" edge.

func (*IPBlockTypeMutation) ResetName

func (m *IPBlockTypeMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*IPBlockTypeMutation) ResetOwnerID

func (m *IPBlockTypeMutation) ResetOwnerID()

ResetOwnerID resets all changes to the "owner_id" field.

func (*IPBlockTypeMutation) ResetUpdatedAt

func (m *IPBlockTypeMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*IPBlockTypeMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*IPBlockTypeMutation) SetField

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

func (m *IPBlockTypeMutation) SetID(id gidx.PrefixedID)

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

func (*IPBlockTypeMutation) SetName

func (m *IPBlockTypeMutation) SetName(s string)

SetName sets the "name" field.

func (*IPBlockTypeMutation) SetOp

func (m *IPBlockTypeMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*IPBlockTypeMutation) SetOwnerID

func (m *IPBlockTypeMutation) SetOwnerID(gi gidx.PrefixedID)

SetOwnerID sets the "owner_id" field.

func (*IPBlockTypeMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (IPBlockTypeMutation) Tx

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

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

func (*IPBlockTypeMutation) Type

func (m *IPBlockTypeMutation) Type() string

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

func (*IPBlockTypeMutation) UpdatedAt

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

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

func (*IPBlockTypeMutation) Where

func (m *IPBlockTypeMutation) Where(ps ...predicate.IPBlockType)

Where appends a list predicates to the IPBlockTypeMutation builder.

func (*IPBlockTypeMutation) WhereP

func (m *IPBlockTypeMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the IPBlockTypeMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type IPBlockTypeOrder

type IPBlockTypeOrder struct {
	Direction OrderDirection         `json:"direction"`
	Field     *IPBlockTypeOrderField `json:"field"`
}

IPBlockTypeOrder defines the ordering of IPBlockType.

type IPBlockTypeOrderField

type IPBlockTypeOrderField struct {
	// Value extracts the ordering value from the given IPBlockType.
	Value func(*IPBlockType) (ent.Value, error)
	// contains filtered or unexported fields
}

IPBlockTypeOrderField defines the ordering field of IPBlockType.

func (IPBlockTypeOrderField) MarshalGQL

func (f IPBlockTypeOrderField) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (IPBlockTypeOrderField) String

func (f IPBlockTypeOrderField) String() string

String implement fmt.Stringer interface.

func (*IPBlockTypeOrderField) UnmarshalGQL

func (f *IPBlockTypeOrderField) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

type IPBlockTypePaginateOption

type IPBlockTypePaginateOption func(*ipblocktypePager) error

IPBlockTypePaginateOption enables pagination customization.

func WithIPBlockTypeFilter

func WithIPBlockTypeFilter(filter func(*IPBlockTypeQuery) (*IPBlockTypeQuery, error)) IPBlockTypePaginateOption

WithIPBlockTypeFilter configures pagination filter.

func WithIPBlockTypeOrder

func WithIPBlockTypeOrder(order *IPBlockTypeOrder) IPBlockTypePaginateOption

WithIPBlockTypeOrder configures pagination ordering.

type IPBlockTypeQuery

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

IPBlockTypeQuery is the builder for querying IPBlockType entities.

func (*IPBlockTypeQuery) Aggregate

func (ibtq *IPBlockTypeQuery) Aggregate(fns ...AggregateFunc) *IPBlockTypeSelect

Aggregate returns a IPBlockTypeSelect configured with the given aggregations.

func (*IPBlockTypeQuery) All

func (ibtq *IPBlockTypeQuery) All(ctx context.Context) ([]*IPBlockType, error)

All executes the query and returns a list of IPBlockTypes.

func (*IPBlockTypeQuery) AllX

func (ibtq *IPBlockTypeQuery) AllX(ctx context.Context) []*IPBlockType

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

func (*IPBlockTypeQuery) Clone

func (ibtq *IPBlockTypeQuery) Clone() *IPBlockTypeQuery

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

func (*IPBlockTypeQuery) CollectFields

func (ibt *IPBlockTypeQuery) CollectFields(ctx context.Context, satisfies ...string) (*IPBlockTypeQuery, error)

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

func (*IPBlockTypeQuery) Count

func (ibtq *IPBlockTypeQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*IPBlockTypeQuery) CountX

func (ibtq *IPBlockTypeQuery) CountX(ctx context.Context) int

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

func (*IPBlockTypeQuery) Exist

func (ibtq *IPBlockTypeQuery) Exist(ctx context.Context) (bool, error)

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

func (*IPBlockTypeQuery) ExistX

func (ibtq *IPBlockTypeQuery) ExistX(ctx context.Context) bool

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

func (*IPBlockTypeQuery) First

func (ibtq *IPBlockTypeQuery) First(ctx context.Context) (*IPBlockType, error)

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

func (*IPBlockTypeQuery) FirstID

func (ibtq *IPBlockTypeQuery) FirstID(ctx context.Context) (id gidx.PrefixedID, err error)

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

func (*IPBlockTypeQuery) FirstIDX

func (ibtq *IPBlockTypeQuery) FirstIDX(ctx context.Context) gidx.PrefixedID

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

func (*IPBlockTypeQuery) FirstX

func (ibtq *IPBlockTypeQuery) FirstX(ctx context.Context) *IPBlockType

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

func (*IPBlockTypeQuery) GroupBy

func (ibtq *IPBlockTypeQuery) GroupBy(field string, fields ...string) *IPBlockTypeGroupBy

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

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.IPBlockType.Query().
	GroupBy(ipblocktype.FieldCreatedAt).
	Aggregate(generated.Count()).
	Scan(ctx, &v)

func (*IPBlockTypeQuery) IDs

func (ibtq *IPBlockTypeQuery) IDs(ctx context.Context) (ids []gidx.PrefixedID, err error)

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

func (*IPBlockTypeQuery) IDsX

func (ibtq *IPBlockTypeQuery) IDsX(ctx context.Context) []gidx.PrefixedID

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

func (*IPBlockTypeQuery) Limit

func (ibtq *IPBlockTypeQuery) Limit(limit int) *IPBlockTypeQuery

Limit the number of records to be returned by this query.

func (*IPBlockTypeQuery) Offset

func (ibtq *IPBlockTypeQuery) Offset(offset int) *IPBlockTypeQuery

Offset to start from.

func (*IPBlockTypeQuery) Only

func (ibtq *IPBlockTypeQuery) Only(ctx context.Context) (*IPBlockType, error)

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

func (*IPBlockTypeQuery) OnlyID

func (ibtq *IPBlockTypeQuery) OnlyID(ctx context.Context) (id gidx.PrefixedID, err error)

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

func (*IPBlockTypeQuery) OnlyIDX

func (ibtq *IPBlockTypeQuery) OnlyIDX(ctx context.Context) gidx.PrefixedID

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

func (*IPBlockTypeQuery) OnlyX

func (ibtq *IPBlockTypeQuery) OnlyX(ctx context.Context) *IPBlockType

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

func (*IPBlockTypeQuery) Order

Order specifies how the records should be ordered.

func (*IPBlockTypeQuery) Paginate

func (ibt *IPBlockTypeQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...IPBlockTypePaginateOption,
) (*IPBlockTypeConnection, error)

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

func (*IPBlockTypeQuery) QueryIPBlock

func (ibtq *IPBlockTypeQuery) QueryIPBlock() *IPBlockQuery

QueryIPBlock chains the current query on the "ip_block" edge.

func (*IPBlockTypeQuery) Select

func (ibtq *IPBlockTypeQuery) Select(fields ...string) *IPBlockTypeSelect

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

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.IPBlockType.Query().
	Select(ipblocktype.FieldCreatedAt).
	Scan(ctx, &v)

func (*IPBlockTypeQuery) Unique

func (ibtq *IPBlockTypeQuery) Unique(unique bool) *IPBlockTypeQuery

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

Where adds a new predicate for the IPBlockTypeQuery builder.

func (*IPBlockTypeQuery) WithIPBlock

func (ibtq *IPBlockTypeQuery) WithIPBlock(opts ...func(*IPBlockQuery)) *IPBlockTypeQuery

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

func (*IPBlockTypeQuery) WithNamedIPBlock

func (ibtq *IPBlockTypeQuery) WithNamedIPBlock(name string, opts ...func(*IPBlockQuery)) *IPBlockTypeQuery

WithNamedIPBlock tells the query-builder to eager-load the nodes that are connected to the "ip_block" edge with the given name. The optional arguments are used to configure the query builder of the edge.

type IPBlockTypeSelect

type IPBlockTypeSelect struct {
	*IPBlockTypeQuery
	// contains filtered or unexported fields
}

IPBlockTypeSelect is the builder for selecting fields of IPBlockType entities.

func (*IPBlockTypeSelect) Aggregate

func (ibts *IPBlockTypeSelect) Aggregate(fns ...AggregateFunc) *IPBlockTypeSelect

Aggregate adds the given aggregation functions to the selector query.

func (*IPBlockTypeSelect) Bool

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

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

func (*IPBlockTypeSelect) BoolX

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

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

func (*IPBlockTypeSelect) Bools

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

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

func (*IPBlockTypeSelect) BoolsX

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

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

func (*IPBlockTypeSelect) Float64

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

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

func (*IPBlockTypeSelect) Float64X

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

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

func (*IPBlockTypeSelect) Float64s

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

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

func (*IPBlockTypeSelect) Float64sX

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

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

func (*IPBlockTypeSelect) Int

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

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

func (*IPBlockTypeSelect) IntX

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

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

func (*IPBlockTypeSelect) Ints

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

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

func (*IPBlockTypeSelect) IntsX

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

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

func (*IPBlockTypeSelect) Scan

func (ibts *IPBlockTypeSelect) Scan(ctx context.Context, v any) error

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

func (*IPBlockTypeSelect) ScanX

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

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

func (*IPBlockTypeSelect) String

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

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

func (*IPBlockTypeSelect) StringX

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

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

func (*IPBlockTypeSelect) Strings

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

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

func (*IPBlockTypeSelect) StringsX

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

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

type IPBlockTypeUpdate

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

IPBlockTypeUpdate is the builder for updating IPBlockType entities.

func (*IPBlockTypeUpdate) AddIPBlock

func (ibtu *IPBlockTypeUpdate) AddIPBlock(i ...*IPBlock) *IPBlockTypeUpdate

AddIPBlock adds the "ip_block" edges to the IPBlock entity.

func (*IPBlockTypeUpdate) AddIPBlockIDs

func (ibtu *IPBlockTypeUpdate) AddIPBlockIDs(ids ...gidx.PrefixedID) *IPBlockTypeUpdate

AddIPBlockIDs adds the "ip_block" edge to the IPBlock entity by IDs.

func (*IPBlockTypeUpdate) ClearIPBlock

func (ibtu *IPBlockTypeUpdate) ClearIPBlock() *IPBlockTypeUpdate

ClearIPBlock clears all "ip_block" edges to the IPBlock entity.

func (*IPBlockTypeUpdate) Exec

func (ibtu *IPBlockTypeUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*IPBlockTypeUpdate) ExecX

func (ibtu *IPBlockTypeUpdate) ExecX(ctx context.Context)

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

func (*IPBlockTypeUpdate) Mutation

func (ibtu *IPBlockTypeUpdate) Mutation() *IPBlockTypeMutation

Mutation returns the IPBlockTypeMutation object of the builder.

func (*IPBlockTypeUpdate) RemoveIPBlock

func (ibtu *IPBlockTypeUpdate) RemoveIPBlock(i ...*IPBlock) *IPBlockTypeUpdate

RemoveIPBlock removes "ip_block" edges to IPBlock entities.

func (*IPBlockTypeUpdate) RemoveIPBlockIDs

func (ibtu *IPBlockTypeUpdate) RemoveIPBlockIDs(ids ...gidx.PrefixedID) *IPBlockTypeUpdate

RemoveIPBlockIDs removes the "ip_block" edge to IPBlock entities by IDs.

func (*IPBlockTypeUpdate) Save

func (ibtu *IPBlockTypeUpdate) Save(ctx context.Context) (int, error)

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

func (*IPBlockTypeUpdate) SaveX

func (ibtu *IPBlockTypeUpdate) SaveX(ctx context.Context) int

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

func (*IPBlockTypeUpdate) SetInput

SetInput applies the change-set in the UpdateIPBlockTypeInput on the IPBlockTypeUpdate builder.

func (*IPBlockTypeUpdate) SetName

func (ibtu *IPBlockTypeUpdate) SetName(s string) *IPBlockTypeUpdate

SetName sets the "name" field.

func (*IPBlockTypeUpdate) Where

Where appends a list predicates to the IPBlockTypeUpdate builder.

type IPBlockTypeUpdateOne

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

IPBlockTypeUpdateOne is the builder for updating a single IPBlockType entity.

func (*IPBlockTypeUpdateOne) AddIPBlock

func (ibtuo *IPBlockTypeUpdateOne) AddIPBlock(i ...*IPBlock) *IPBlockTypeUpdateOne

AddIPBlock adds the "ip_block" edges to the IPBlock entity.

func (*IPBlockTypeUpdateOne) AddIPBlockIDs

func (ibtuo *IPBlockTypeUpdateOne) AddIPBlockIDs(ids ...gidx.PrefixedID) *IPBlockTypeUpdateOne

AddIPBlockIDs adds the "ip_block" edge to the IPBlock entity by IDs.

func (*IPBlockTypeUpdateOne) ClearIPBlock

func (ibtuo *IPBlockTypeUpdateOne) ClearIPBlock() *IPBlockTypeUpdateOne

ClearIPBlock clears all "ip_block" edges to the IPBlock entity.

func (*IPBlockTypeUpdateOne) Exec

func (ibtuo *IPBlockTypeUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*IPBlockTypeUpdateOne) ExecX

func (ibtuo *IPBlockTypeUpdateOne) ExecX(ctx context.Context)

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

func (*IPBlockTypeUpdateOne) Mutation

func (ibtuo *IPBlockTypeUpdateOne) Mutation() *IPBlockTypeMutation

Mutation returns the IPBlockTypeMutation object of the builder.

func (*IPBlockTypeUpdateOne) RemoveIPBlock

func (ibtuo *IPBlockTypeUpdateOne) RemoveIPBlock(i ...*IPBlock) *IPBlockTypeUpdateOne

RemoveIPBlock removes "ip_block" edges to IPBlock entities.

func (*IPBlockTypeUpdateOne) RemoveIPBlockIDs

func (ibtuo *IPBlockTypeUpdateOne) RemoveIPBlockIDs(ids ...gidx.PrefixedID) *IPBlockTypeUpdateOne

RemoveIPBlockIDs removes the "ip_block" edge to IPBlock entities by IDs.

func (*IPBlockTypeUpdateOne) Save

func (ibtuo *IPBlockTypeUpdateOne) Save(ctx context.Context) (*IPBlockType, error)

Save executes the query and returns the updated IPBlockType entity.

func (*IPBlockTypeUpdateOne) SaveX

func (ibtuo *IPBlockTypeUpdateOne) SaveX(ctx context.Context) *IPBlockType

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

func (*IPBlockTypeUpdateOne) Select

func (ibtuo *IPBlockTypeUpdateOne) Select(field string, fields ...string) *IPBlockTypeUpdateOne

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

func (*IPBlockTypeUpdateOne) SetInput

SetInput applies the change-set in the UpdateIPBlockTypeInput on the IPBlockTypeUpdateOne builder.

func (*IPBlockTypeUpdateOne) SetName

SetName sets the "name" field.

func (*IPBlockTypeUpdateOne) Where

Where appends a list predicates to the IPBlockTypeUpdate builder.

type IPBlockTypeWhereInput

type IPBlockTypeWhereInput struct {
	Predicates []predicate.IPBlockType  `json:"-"`
	Not        *IPBlockTypeWhereInput   `json:"not,omitempty"`
	Or         []*IPBlockTypeWhereInput `json:"or,omitempty"`
	And        []*IPBlockTypeWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID      *gidx.PrefixedID  `json:"id,omitempty"`
	IDNEQ   *gidx.PrefixedID  `json:"idNEQ,omitempty"`
	IDIn    []gidx.PrefixedID `json:"idIn,omitempty"`
	IDNotIn []gidx.PrefixedID `json:"idNotIn,omitempty"`
	IDGT    *gidx.PrefixedID  `json:"idGT,omitempty"`
	IDGTE   *gidx.PrefixedID  `json:"idGTE,omitempty"`
	IDLT    *gidx.PrefixedID  `json:"idLT,omitempty"`
	IDLTE   *gidx.PrefixedID  `json:"idLTE,omitempty"`

	// "created_at" field predicates.
	CreatedAt      *time.Time  `json:"createdAt,omitempty"`
	CreatedAtNEQ   *time.Time  `json:"createdAtNEQ,omitempty"`
	CreatedAtIn    []time.Time `json:"createdAtIn,omitempty"`
	CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"`
	CreatedAtGT    *time.Time  `json:"createdAtGT,omitempty"`
	CreatedAtGTE   *time.Time  `json:"createdAtGTE,omitempty"`
	CreatedAtLT    *time.Time  `json:"createdAtLT,omitempty"`
	CreatedAtLTE   *time.Time  `json:"createdAtLTE,omitempty"`

	// "updated_at" field predicates.
	UpdatedAt      *time.Time  `json:"updatedAt,omitempty"`
	UpdatedAtNEQ   *time.Time  `json:"updatedAtNEQ,omitempty"`
	UpdatedAtIn    []time.Time `json:"updatedAtIn,omitempty"`
	UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"`
	UpdatedAtGT    *time.Time  `json:"updatedAtGT,omitempty"`
	UpdatedAtGTE   *time.Time  `json:"updatedAtGTE,omitempty"`
	UpdatedAtLT    *time.Time  `json:"updatedAtLT,omitempty"`
	UpdatedAtLTE   *time.Time  `json:"updatedAtLTE,omitempty"`

	// "name" field predicates.
	Name             *string  `json:"name,omitempty"`
	NameNEQ          *string  `json:"nameNEQ,omitempty"`
	NameIn           []string `json:"nameIn,omitempty"`
	NameNotIn        []string `json:"nameNotIn,omitempty"`
	NameGT           *string  `json:"nameGT,omitempty"`
	NameGTE          *string  `json:"nameGTE,omitempty"`
	NameLT           *string  `json:"nameLT,omitempty"`
	NameLTE          *string  `json:"nameLTE,omitempty"`
	NameContains     *string  `json:"nameContains,omitempty"`
	NameHasPrefix    *string  `json:"nameHasPrefix,omitempty"`
	NameHasSuffix    *string  `json:"nameHasSuffix,omitempty"`
	NameEqualFold    *string  `json:"nameEqualFold,omitempty"`
	NameContainsFold *string  `json:"nameContainsFold,omitempty"`

	// "ip_block" edge predicates.
	HasIPBlock     *bool                `json:"hasIPBlock,omitempty"`
	HasIPBlockWith []*IPBlockWhereInput `json:"hasIPBlockWith,omitempty"`
}

IPBlockTypeWhereInput represents a where input for filtering IPBlockType queries.

func (*IPBlockTypeWhereInput) AddPredicates

func (i *IPBlockTypeWhereInput) AddPredicates(predicates ...predicate.IPBlockType)

AddPredicates adds custom predicates to the where input to be used during the filtering phase.

func (*IPBlockTypeWhereInput) Filter

Filter applies the IPBlockTypeWhereInput filter on the IPBlockTypeQuery builder.

func (*IPBlockTypeWhereInput) P

P returns a predicate for filtering ipblocktypes. An error is returned if the input is empty or invalid.

type IPBlockTypes

type IPBlockTypes []*IPBlockType

IPBlockTypes is a parsable slice of IPBlockType.

type IPBlockUpdate

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

IPBlockUpdate is the builder for updating IPBlock entities.

func (*IPBlockUpdate) AddIPAddresIDs

func (ibu *IPBlockUpdate) AddIPAddresIDs(ids ...gidx.PrefixedID) *IPBlockUpdate

AddIPAddresIDs adds the "ip_address" edge to the IPAddress entity by IDs.

func (*IPBlockUpdate) AddIPAddress

func (ibu *IPBlockUpdate) AddIPAddress(i ...*IPAddress) *IPBlockUpdate

AddIPAddress adds the "ip_address" edges to the IPAddress entity.

func (*IPBlockUpdate) ClearIPAddress

func (ibu *IPBlockUpdate) ClearIPAddress() *IPBlockUpdate

ClearIPAddress clears all "ip_address" edges to the IPAddress entity.

func (*IPBlockUpdate) Exec

func (ibu *IPBlockUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*IPBlockUpdate) ExecX

func (ibu *IPBlockUpdate) ExecX(ctx context.Context)

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

func (*IPBlockUpdate) Mutation

func (ibu *IPBlockUpdate) Mutation() *IPBlockMutation

Mutation returns the IPBlockMutation object of the builder.

func (*IPBlockUpdate) RemoveIPAddresIDs

func (ibu *IPBlockUpdate) RemoveIPAddresIDs(ids ...gidx.PrefixedID) *IPBlockUpdate

RemoveIPAddresIDs removes the "ip_address" edge to IPAddress entities by IDs.

func (*IPBlockUpdate) RemoveIPAddress

func (ibu *IPBlockUpdate) RemoveIPAddress(i ...*IPAddress) *IPBlockUpdate

RemoveIPAddress removes "ip_address" edges to IPAddress entities.

func (*IPBlockUpdate) Save

func (ibu *IPBlockUpdate) Save(ctx context.Context) (int, error)

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

func (*IPBlockUpdate) SaveX

func (ibu *IPBlockUpdate) SaveX(ctx context.Context) int

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

func (*IPBlockUpdate) SetAllowAutoAllocate

func (ibu *IPBlockUpdate) SetAllowAutoAllocate(b bool) *IPBlockUpdate

SetAllowAutoAllocate sets the "allow_auto_allocate" field.

func (*IPBlockUpdate) SetAllowAutoSubnet

func (ibu *IPBlockUpdate) SetAllowAutoSubnet(b bool) *IPBlockUpdate

SetAllowAutoSubnet sets the "allow_auto_subnet" field.

func (*IPBlockUpdate) SetInput

SetInput applies the change-set in the UpdateIPBlockInput on the IPBlockUpdate builder.

func (*IPBlockUpdate) SetNillableAllowAutoAllocate

func (ibu *IPBlockUpdate) SetNillableAllowAutoAllocate(b *bool) *IPBlockUpdate

SetNillableAllowAutoAllocate sets the "allow_auto_allocate" field if the given value is not nil.

func (*IPBlockUpdate) SetNillableAllowAutoSubnet

func (ibu *IPBlockUpdate) SetNillableAllowAutoSubnet(b *bool) *IPBlockUpdate

SetNillableAllowAutoSubnet sets the "allow_auto_subnet" field if the given value is not nil.

func (*IPBlockUpdate) SetPrefix

func (ibu *IPBlockUpdate) SetPrefix(s string) *IPBlockUpdate

SetPrefix sets the "prefix" field.

func (*IPBlockUpdate) Where

func (ibu *IPBlockUpdate) Where(ps ...predicate.IPBlock) *IPBlockUpdate

Where appends a list predicates to the IPBlockUpdate builder.

type IPBlockUpdateOne

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

IPBlockUpdateOne is the builder for updating a single IPBlock entity.

func (*IPBlockUpdateOne) AddIPAddresIDs

func (ibuo *IPBlockUpdateOne) AddIPAddresIDs(ids ...gidx.PrefixedID) *IPBlockUpdateOne

AddIPAddresIDs adds the "ip_address" edge to the IPAddress entity by IDs.

func (*IPBlockUpdateOne) AddIPAddress

func (ibuo *IPBlockUpdateOne) AddIPAddress(i ...*IPAddress) *IPBlockUpdateOne

AddIPAddress adds the "ip_address" edges to the IPAddress entity.

func (*IPBlockUpdateOne) ClearIPAddress

func (ibuo *IPBlockUpdateOne) ClearIPAddress() *IPBlockUpdateOne

ClearIPAddress clears all "ip_address" edges to the IPAddress entity.

func (*IPBlockUpdateOne) Exec

func (ibuo *IPBlockUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*IPBlockUpdateOne) ExecX

func (ibuo *IPBlockUpdateOne) ExecX(ctx context.Context)

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

func (*IPBlockUpdateOne) Mutation

func (ibuo *IPBlockUpdateOne) Mutation() *IPBlockMutation

Mutation returns the IPBlockMutation object of the builder.

func (*IPBlockUpdateOne) RemoveIPAddresIDs

func (ibuo *IPBlockUpdateOne) RemoveIPAddresIDs(ids ...gidx.PrefixedID) *IPBlockUpdateOne

RemoveIPAddresIDs removes the "ip_address" edge to IPAddress entities by IDs.

func (*IPBlockUpdateOne) RemoveIPAddress

func (ibuo *IPBlockUpdateOne) RemoveIPAddress(i ...*IPAddress) *IPBlockUpdateOne

RemoveIPAddress removes "ip_address" edges to IPAddress entities.

func (*IPBlockUpdateOne) Save

func (ibuo *IPBlockUpdateOne) Save(ctx context.Context) (*IPBlock, error)

Save executes the query and returns the updated IPBlock entity.

func (*IPBlockUpdateOne) SaveX

func (ibuo *IPBlockUpdateOne) SaveX(ctx context.Context) *IPBlock

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

func (*IPBlockUpdateOne) Select

func (ibuo *IPBlockUpdateOne) Select(field string, fields ...string) *IPBlockUpdateOne

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

func (*IPBlockUpdateOne) SetAllowAutoAllocate

func (ibuo *IPBlockUpdateOne) SetAllowAutoAllocate(b bool) *IPBlockUpdateOne

SetAllowAutoAllocate sets the "allow_auto_allocate" field.

func (*IPBlockUpdateOne) SetAllowAutoSubnet

func (ibuo *IPBlockUpdateOne) SetAllowAutoSubnet(b bool) *IPBlockUpdateOne

SetAllowAutoSubnet sets the "allow_auto_subnet" field.

func (*IPBlockUpdateOne) SetInput

SetInput applies the change-set in the UpdateIPBlockInput on the IPBlockUpdateOne builder.

func (*IPBlockUpdateOne) SetNillableAllowAutoAllocate

func (ibuo *IPBlockUpdateOne) SetNillableAllowAutoAllocate(b *bool) *IPBlockUpdateOne

SetNillableAllowAutoAllocate sets the "allow_auto_allocate" field if the given value is not nil.

func (*IPBlockUpdateOne) SetNillableAllowAutoSubnet

func (ibuo *IPBlockUpdateOne) SetNillableAllowAutoSubnet(b *bool) *IPBlockUpdateOne

SetNillableAllowAutoSubnet sets the "allow_auto_subnet" field if the given value is not nil.

func (*IPBlockUpdateOne) SetPrefix

func (ibuo *IPBlockUpdateOne) SetPrefix(s string) *IPBlockUpdateOne

SetPrefix sets the "prefix" field.

func (*IPBlockUpdateOne) Where

func (ibuo *IPBlockUpdateOne) Where(ps ...predicate.IPBlock) *IPBlockUpdateOne

Where appends a list predicates to the IPBlockUpdate builder.

type IPBlockWhereInput

type IPBlockWhereInput struct {
	Predicates []predicate.IPBlock  `json:"-"`
	Not        *IPBlockWhereInput   `json:"not,omitempty"`
	Or         []*IPBlockWhereInput `json:"or,omitempty"`
	And        []*IPBlockWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID      *gidx.PrefixedID  `json:"id,omitempty"`
	IDNEQ   *gidx.PrefixedID  `json:"idNEQ,omitempty"`
	IDIn    []gidx.PrefixedID `json:"idIn,omitempty"`
	IDNotIn []gidx.PrefixedID `json:"idNotIn,omitempty"`
	IDGT    *gidx.PrefixedID  `json:"idGT,omitempty"`
	IDGTE   *gidx.PrefixedID  `json:"idGTE,omitempty"`
	IDLT    *gidx.PrefixedID  `json:"idLT,omitempty"`
	IDLTE   *gidx.PrefixedID  `json:"idLTE,omitempty"`

	// "created_at" field predicates.
	CreatedAt      *time.Time  `json:"createdAt,omitempty"`
	CreatedAtNEQ   *time.Time  `json:"createdAtNEQ,omitempty"`
	CreatedAtIn    []time.Time `json:"createdAtIn,omitempty"`
	CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"`
	CreatedAtGT    *time.Time  `json:"createdAtGT,omitempty"`
	CreatedAtGTE   *time.Time  `json:"createdAtGTE,omitempty"`
	CreatedAtLT    *time.Time  `json:"createdAtLT,omitempty"`
	CreatedAtLTE   *time.Time  `json:"createdAtLTE,omitempty"`

	// "updated_at" field predicates.
	UpdatedAt      *time.Time  `json:"updatedAt,omitempty"`
	UpdatedAtNEQ   *time.Time  `json:"updatedAtNEQ,omitempty"`
	UpdatedAtIn    []time.Time `json:"updatedAtIn,omitempty"`
	UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"`
	UpdatedAtGT    *time.Time  `json:"updatedAtGT,omitempty"`
	UpdatedAtGTE   *time.Time  `json:"updatedAtGTE,omitempty"`
	UpdatedAtLT    *time.Time  `json:"updatedAtLT,omitempty"`
	UpdatedAtLTE   *time.Time  `json:"updatedAtLTE,omitempty"`

	// "prefix" field predicates.
	Prefix             *string  `json:"prefix,omitempty"`
	PrefixNEQ          *string  `json:"prefixNEQ,omitempty"`
	PrefixIn           []string `json:"prefixIn,omitempty"`
	PrefixNotIn        []string `json:"prefixNotIn,omitempty"`
	PrefixGT           *string  `json:"prefixGT,omitempty"`
	PrefixGTE          *string  `json:"prefixGTE,omitempty"`
	PrefixLT           *string  `json:"prefixLT,omitempty"`
	PrefixLTE          *string  `json:"prefixLTE,omitempty"`
	PrefixContains     *string  `json:"prefixContains,omitempty"`
	PrefixHasPrefix    *string  `json:"prefixHasPrefix,omitempty"`
	PrefixHasSuffix    *string  `json:"prefixHasSuffix,omitempty"`
	PrefixEqualFold    *string  `json:"prefixEqualFold,omitempty"`
	PrefixContainsFold *string  `json:"prefixContainsFold,omitempty"`

	// "allow_auto_subnet" field predicates.
	AllowAutoSubnet    *bool `json:"allowAutoSubnet,omitempty"`
	AllowAutoSubnetNEQ *bool `json:"allowAutoSubnetNEQ,omitempty"`

	// "allow_auto_allocate" field predicates.
	AllowAutoAllocate    *bool `json:"allowAutoAllocate,omitempty"`
	AllowAutoAllocateNEQ *bool `json:"allowAutoAllocateNEQ,omitempty"`

	// "ip_block_type" edge predicates.
	HasIPBlockType     *bool                    `json:"hasIPBlockType,omitempty"`
	HasIPBlockTypeWith []*IPBlockTypeWhereInput `json:"hasIPBlockTypeWith,omitempty"`

	// "ip_address" edge predicates.
	HasIPAddress     *bool                  `json:"hasIPAddress,omitempty"`
	HasIPAddressWith []*IPAddressWhereInput `json:"hasIPAddressWith,omitempty"`
}

IPBlockWhereInput represents a where input for filtering IPBlock queries.

func (*IPBlockWhereInput) AddPredicates

func (i *IPBlockWhereInput) AddPredicates(predicates ...predicate.IPBlock)

AddPredicates adds custom predicates to the where input to be used during the filtering phase.

func (*IPBlockWhereInput) Filter

Filter applies the IPBlockWhereInput filter on the IPBlockQuery builder.

func (*IPBlockWhereInput) P

P returns a predicate for filtering ipblocks. An error is returned if the input is empty or invalid.

type IPBlocks

type IPBlocks []*IPBlock

IPBlocks is a parsable slice of IPBlock.

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

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

type Interceptor

type Interceptor = ent.Interceptor

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

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

type NodeOption

type NodeOption func(*nodeOptions)

NodeOption allows configuring the Noder execution using functional options.

func WithFixedNodeType

func WithFixedNodeType(t string) NodeOption

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

func WithNodeType

func WithNodeType(f func(context.Context, gidx.PrefixedID) (string, error)) NodeOption

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

type Noder

type Noder interface {
	IsNode()
}

Noder wraps the basic Node method.

type NotFoundError

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

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

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

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

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

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

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

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

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func EventsPublisher

func EventsPublisher(v events.Connection) Option

EventsPublisher configures the EventsPublisher.

func Log

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

Log sets the logging function for debug mode.

type OrderDirection

type OrderDirection = entgql.OrderDirection

Common entgql types.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.

type PageInfo

type PageInfo = entgql.PageInfo[gidx.PrefixedID]

Common entgql types.

type Policy

type Policy = ent.Policy

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

type Querier

type Querier = ent.Querier

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

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

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

type Query

type Query = ent.Query

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

type QueryContext

type QueryContext = ent.QueryContext

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

type RollbackFunc

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

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

func (RollbackFunc) Rollback

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

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

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

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

type Rollbacker

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

Rollbacker is the interface that wraps the Rollback method.

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

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

type Traverser

type Traverser = ent.Traverser

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

type Tx

type Tx struct {

	// IPAddress is the client for interacting with the IPAddress builders.
	IPAddress *IPAddressClient
	// IPBlock is the client for interacting with the IPBlock builders.
	IPBlock *IPBlockClient
	// IPBlockType is the client for interacting with the IPBlockType builders.
	IPBlockType *IPBlockTypeClient
	// 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 UpdateIPAddressInput

type UpdateIPAddressInput struct {
	IP       *string
	Reserved *bool
}

UpdateIPAddressInput represents a mutation input for updating ipaddresses.

func (*UpdateIPAddressInput) Mutate

Mutate applies the UpdateIPAddressInput on the IPAddressMutation builder.

type UpdateIPBlockInput

type UpdateIPBlockInput struct {
	Prefix            *string
	AllowAutoSubnet   *bool
	AllowAutoAllocate *bool
}

UpdateIPBlockInput represents a mutation input for updating ipblocks.

func (*UpdateIPBlockInput) Mutate

func (i *UpdateIPBlockInput) Mutate(m *IPBlockMutation)

Mutate applies the UpdateIPBlockInput on the IPBlockMutation builder.

type UpdateIPBlockTypeInput

type UpdateIPBlockTypeInput struct {
	Name *string
}

UpdateIPBlockTypeInput represents a mutation input for updating ipblocktypes.

func (*UpdateIPBlockTypeInput) Mutate

Mutate applies the UpdateIPBlockTypeInput on the IPBlockTypeMutation builder.

type ValidationError

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

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL