models

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2021 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSyncFail = errors.New("models: failed to synchronize data after insert")

ErrSyncFail occurs during insert when the record could not be retrieved in order to populate default value information. This usually happens when LastInsertId fails or there was a primary key configuration that was not resolvable.

View Source
var GorpMigrationColumns = struct {
	ID        string
	AppliedAt string
}{
	ID:        "id",
	AppliedAt: "applied_at",
}
View Source
var GorpMigrationRels = struct {
}{}

GorpMigrationRels is where relationship names are stored.

View Source
var GorpMigrationWhere = struct {
	ID        whereHelperstring
	AppliedAt whereHelpernull_Time
}{
	ID:        whereHelperstring{/* contains filtered or unexported fields */},
	AppliedAt: whereHelpernull_Time{/* contains filtered or unexported fields */},
}
View Source
var NodeColumns = struct {
	ID         string
	CreatedAt  string
	MacAddress string
	IPAddress  string
	NodeScanID string
}{
	ID:         "id",
	CreatedAt:  "created_at",
	MacAddress: "mac_address",
	IPAddress:  "ip_address",
	NodeScanID: "node_scan_id",
}
View Source
var NodeRels = struct {
	NodeScan  string
	PortScans string
}{
	NodeScan:  "NodeScan",
	PortScans: "PortScans",
}

NodeRels is where relationship names are stored.

View Source
var NodeScanColumns = struct {
	ID        string
	CreatedAt string
	Done      string
}{
	ID:        "id",
	CreatedAt: "created_at",
	Done:      "done",
}
View Source
var NodeScanRels = struct {
	Nodes string
}{
	Nodes: "Nodes",
}

NodeScanRels is where relationship names are stored.

View Source
var NodeScanWhere = struct {
	ID        whereHelperint64
	CreatedAt whereHelpertime_Time
	Done      whereHelperint64
}{
	ID:        whereHelperint64{/* contains filtered or unexported fields */},
	CreatedAt: whereHelpertime_Time{/* contains filtered or unexported fields */},
	Done:      whereHelperint64{/* contains filtered or unexported fields */},
}
View Source
var NodeWhere = struct {
	ID         whereHelperint64
	CreatedAt  whereHelpertime_Time
	MacAddress whereHelperstring
	IPAddress  whereHelperstring
	NodeScanID whereHelperint64
}{
	ID:         whereHelperint64{/* contains filtered or unexported fields */},
	CreatedAt:  whereHelpertime_Time{/* contains filtered or unexported fields */},
	MacAddress: whereHelperstring{/* contains filtered or unexported fields */},
	IPAddress:  whereHelperstring{/* contains filtered or unexported fields */},
	NodeScanID: whereHelperint64{/* contains filtered or unexported fields */},
}
View Source
var PortColumns = struct {
	ID                string
	CreatedAt         string
	PortNumber        string
	TransportProtocol string
	PortScanID        string
}{
	ID:                "id",
	CreatedAt:         "created_at",
	PortNumber:        "port_number",
	TransportProtocol: "transport_protocol",
	PortScanID:        "port_scan_id",
}
View Source
var PortRels = struct {
	PortScan string
}{
	PortScan: "PortScan",
}

PortRels is where relationship names are stored.

View Source
var PortScanColumns = struct {
	ID        string
	CreatedAt string
	Done      string
	NodeID    string
}{
	ID:        "id",
	CreatedAt: "created_at",
	Done:      "done",
	NodeID:    "node_id",
}
View Source
var PortScanRels = struct {
	Node  string
	Ports string
}{
	Node:  "Node",
	Ports: "Ports",
}

PortScanRels is where relationship names are stored.

View Source
var PortScanWhere = struct {
	ID        whereHelperint64
	CreatedAt whereHelpertime_Time
	Done      whereHelperint64
	NodeID    whereHelperint64
}{
	ID:        whereHelperint64{/* contains filtered or unexported fields */},
	CreatedAt: whereHelpertime_Time{/* contains filtered or unexported fields */},
	Done:      whereHelperint64{/* contains filtered or unexported fields */},
	NodeID:    whereHelperint64{/* contains filtered or unexported fields */},
}
View Source
var PortWhere = struct {
	ID                whereHelperint64
	CreatedAt         whereHelpertime_Time
	PortNumber        whereHelperint64
	TransportProtocol whereHelperstring
	PortScanID        whereHelperint64
}{
	ID:                whereHelperint64{/* contains filtered or unexported fields */},
	CreatedAt:         whereHelpertime_Time{/* contains filtered or unexported fields */},
	PortNumber:        whereHelperint64{/* contains filtered or unexported fields */},
	TransportProtocol: whereHelperstring{/* contains filtered or unexported fields */},
	PortScanID:        whereHelperint64{/* contains filtered or unexported fields */},
}
View Source
var TableNames = struct {
	GorpMigrations string
	NodeScans      string
	Nodes          string
	PortScans      string
	Ports          string
}{
	GorpMigrations: "gorp_migrations",
	NodeScans:      "node_scans",
	Nodes:          "nodes",
	PortScans:      "port_scans",
	Ports:          "ports",
}

Functions

func AddGorpMigrationHook

func AddGorpMigrationHook(hookPoint boil.HookPoint, gorpMigrationHook GorpMigrationHook)

AddGorpMigrationHook registers your hook function for all future operations.

func AddNodeHook

func AddNodeHook(hookPoint boil.HookPoint, nodeHook NodeHook)

AddNodeHook registers your hook function for all future operations.

func AddNodeScanHook

func AddNodeScanHook(hookPoint boil.HookPoint, nodeScanHook NodeScanHook)

AddNodeScanHook registers your hook function for all future operations.

func AddPortHook

func AddPortHook(hookPoint boil.HookPoint, portHook PortHook)

AddPortHook registers your hook function for all future operations.

func AddPortScanHook

func AddPortScanHook(hookPoint boil.HookPoint, portScanHook PortScanHook)

AddPortScanHook registers your hook function for all future operations.

func GorpMigrationExists

func GorpMigrationExists(ctx context.Context, exec boil.ContextExecutor, iD string) (bool, error)

GorpMigrationExists checks if the GorpMigration row exists.

func GorpMigrations

func GorpMigrations(mods ...qm.QueryMod) gorpMigrationQuery

GorpMigrations retrieves all the records using an executor.

func NewQuery

func NewQuery(mods ...qm.QueryMod) *queries.Query

NewQuery initializes a new Query using the passed in QueryMods

func NodeExists

func NodeExists(ctx context.Context, exec boil.ContextExecutor, iD int64) (bool, error)

NodeExists checks if the Node row exists.

func NodeScanExists

func NodeScanExists(ctx context.Context, exec boil.ContextExecutor, iD int64) (bool, error)

NodeScanExists checks if the NodeScan row exists.

func NodeScans

func NodeScans(mods ...qm.QueryMod) nodeScanQuery

NodeScans retrieves all the records using an executor.

func Nodes

func Nodes(mods ...qm.QueryMod) nodeQuery

Nodes retrieves all the records using an executor.

func PortExists

func PortExists(ctx context.Context, exec boil.ContextExecutor, iD int64) (bool, error)

PortExists checks if the Port row exists.

func PortScanExists

func PortScanExists(ctx context.Context, exec boil.ContextExecutor, iD int64) (bool, error)

PortScanExists checks if the PortScan row exists.

func PortScans

func PortScans(mods ...qm.QueryMod) portScanQuery

PortScans retrieves all the records using an executor.

func Ports

func Ports(mods ...qm.QueryMod) portQuery

Ports retrieves all the records using an executor.

Types

type GorpMigration

type GorpMigration struct {
	ID        string    `boil:"id" json:"id" toml:"id" yaml:"id"`
	AppliedAt null.Time `boil:"applied_at" json:"applied_at,omitempty" toml:"applied_at" yaml:"applied_at,omitempty"`

	R *gorpMigrationR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L gorpMigrationL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

GorpMigration is an object representing the database table.

func FindGorpMigration

func FindGorpMigration(ctx context.Context, exec boil.ContextExecutor, iD string, selectCols ...string) (*GorpMigration, error)

FindGorpMigration retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.

func (*GorpMigration) Delete

func (o *GorpMigration) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)

Delete deletes a single GorpMigration record with an executor. Delete will match against the primary key column to find the record to delete.

func (*GorpMigration) Insert

func (o *GorpMigration) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error

Insert a single record using an executor. See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts.

func (*GorpMigration) Reload

func (o *GorpMigration) Reload(ctx context.Context, exec boil.ContextExecutor) error

Reload refetches the object from the database using the primary keys with an executor.

func (*GorpMigration) Update

func (o *GorpMigration) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)

Update uses an executor to update the GorpMigration. See boil.Columns.UpdateColumnSet documentation to understand column list inference for updates. Update does not automatically update the record in case of default values. Use .Reload() to refresh the records.

type GorpMigrationHook

type GorpMigrationHook func(context.Context, boil.ContextExecutor, *GorpMigration) error

GorpMigrationHook is the signature for custom GorpMigration hook methods

type GorpMigrationSlice

type GorpMigrationSlice []*GorpMigration

GorpMigrationSlice is an alias for a slice of pointers to GorpMigration. This should generally be used opposed to []GorpMigration.

func (GorpMigrationSlice) DeleteAll

func (o GorpMigrationSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error)

DeleteAll deletes all rows in the slice, using an executor.

func (*GorpMigrationSlice) ReloadAll

func (o *GorpMigrationSlice) ReloadAll(ctx context.Context, exec boil.ContextExecutor) error

ReloadAll refetches every row with matching primary key column values and overwrites the original object slice with the newly updated slice.

func (GorpMigrationSlice) UpdateAll

func (o GorpMigrationSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error)

UpdateAll updates all rows with the specified column values, using an executor.

type M

type M map[string]interface{}

M type is for providing columns and column values to UpdateAll.

type Node

type Node struct {
	ID         int64     `boil:"id" json:"id" toml:"id" yaml:"id"`
	CreatedAt  time.Time `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"`
	MacAddress string    `boil:"mac_address" json:"mac_address" toml:"mac_address" yaml:"mac_address"`
	IPAddress  string    `boil:"ip_address" json:"ip_address" toml:"ip_address" yaml:"ip_address"`
	NodeScanID int64     `boil:"node_scan_id" json:"node_scan_id" toml:"node_scan_id" yaml:"node_scan_id"`

	R *nodeR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L nodeL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Node is an object representing the database table.

func FindNode

func FindNode(ctx context.Context, exec boil.ContextExecutor, iD int64, selectCols ...string) (*Node, error)

FindNode retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.

func (*Node) AddPortScans

func (o *Node) AddPortScans(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*PortScan) error

AddPortScans adds the given related objects to the existing relationships of the node, optionally inserting them as new records. Appends related to o.R.PortScans. Sets related.R.Node appropriately.

func (*Node) Delete

func (o *Node) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)

Delete deletes a single Node record with an executor. Delete will match against the primary key column to find the record to delete.

func (*Node) Insert

func (o *Node) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error

Insert a single record using an executor. See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts.

func (*Node) NodeScan

func (o *Node) NodeScan(mods ...qm.QueryMod) nodeScanQuery

NodeScan pointed to by the foreign key.

func (*Node) PortScans

func (o *Node) PortScans(mods ...qm.QueryMod) portScanQuery

PortScans retrieves all the port_scan's PortScans with an executor.

func (*Node) Reload

func (o *Node) Reload(ctx context.Context, exec boil.ContextExecutor) error

Reload refetches the object from the database using the primary keys with an executor.

func (*Node) SetNodeScan

func (o *Node) SetNodeScan(ctx context.Context, exec boil.ContextExecutor, insert bool, related *NodeScan) error

SetNodeScan of the node to the related item. Sets o.R.NodeScan to related. Adds o to related.R.Nodes.

func (*Node) Update

func (o *Node) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)

Update uses an executor to update the Node. See boil.Columns.UpdateColumnSet documentation to understand column list inference for updates. Update does not automatically update the record in case of default values. Use .Reload() to refresh the records.

type NodeHook

type NodeHook func(context.Context, boil.ContextExecutor, *Node) error

NodeHook is the signature for custom Node hook methods

type NodeScan

type NodeScan struct {
	ID        int64     `boil:"id" json:"id" toml:"id" yaml:"id"`
	CreatedAt time.Time `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"`
	Done      int64     `boil:"done" json:"done" toml:"done" yaml:"done"`

	R *nodeScanR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L nodeScanL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

NodeScan is an object representing the database table.

func FindNodeScan

func FindNodeScan(ctx context.Context, exec boil.ContextExecutor, iD int64, selectCols ...string) (*NodeScan, error)

FindNodeScan retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.

func (*NodeScan) AddNodes

func (o *NodeScan) AddNodes(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Node) error

AddNodes adds the given related objects to the existing relationships of the node_scan, optionally inserting them as new records. Appends related to o.R.Nodes. Sets related.R.NodeScan appropriately.

func (*NodeScan) Delete

func (o *NodeScan) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)

Delete deletes a single NodeScan record with an executor. Delete will match against the primary key column to find the record to delete.

func (*NodeScan) Insert

func (o *NodeScan) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error

Insert a single record using an executor. See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts.

func (*NodeScan) Nodes

func (o *NodeScan) Nodes(mods ...qm.QueryMod) nodeQuery

Nodes retrieves all the node's Nodes with an executor.

func (*NodeScan) Reload

func (o *NodeScan) Reload(ctx context.Context, exec boil.ContextExecutor) error

Reload refetches the object from the database using the primary keys with an executor.

func (*NodeScan) Update

func (o *NodeScan) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)

Update uses an executor to update the NodeScan. See boil.Columns.UpdateColumnSet documentation to understand column list inference for updates. Update does not automatically update the record in case of default values. Use .Reload() to refresh the records.

type NodeScanHook

type NodeScanHook func(context.Context, boil.ContextExecutor, *NodeScan) error

NodeScanHook is the signature for custom NodeScan hook methods

type NodeScanSlice

type NodeScanSlice []*NodeScan

NodeScanSlice is an alias for a slice of pointers to NodeScan. This should generally be used opposed to []NodeScan.

func (NodeScanSlice) DeleteAll

func (o NodeScanSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error)

DeleteAll deletes all rows in the slice, using an executor.

func (*NodeScanSlice) ReloadAll

func (o *NodeScanSlice) ReloadAll(ctx context.Context, exec boil.ContextExecutor) error

ReloadAll refetches every row with matching primary key column values and overwrites the original object slice with the newly updated slice.

func (NodeScanSlice) UpdateAll

func (o NodeScanSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error)

UpdateAll updates all rows with the specified column values, using an executor.

type NodeSlice

type NodeSlice []*Node

NodeSlice is an alias for a slice of pointers to Node. This should generally be used opposed to []Node.

func (NodeSlice) DeleteAll

func (o NodeSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error)

DeleteAll deletes all rows in the slice, using an executor.

func (*NodeSlice) ReloadAll

func (o *NodeSlice) ReloadAll(ctx context.Context, exec boil.ContextExecutor) error

ReloadAll refetches every row with matching primary key column values and overwrites the original object slice with the newly updated slice.

func (NodeSlice) UpdateAll

func (o NodeSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error)

UpdateAll updates all rows with the specified column values, using an executor.

type Port

type Port struct {
	ID                int64     `boil:"id" json:"id" toml:"id" yaml:"id"`
	CreatedAt         time.Time `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"`
	PortNumber        int64     `boil:"port_number" json:"port_number" toml:"port_number" yaml:"port_number"`
	TransportProtocol string    `boil:"transport_protocol" json:"transport_protocol" toml:"transport_protocol" yaml:"transport_protocol"`
	PortScanID        int64     `boil:"port_scan_id" json:"port_scan_id" toml:"port_scan_id" yaml:"port_scan_id"`

	R *portR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L portL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Port is an object representing the database table.

func FindPort

func FindPort(ctx context.Context, exec boil.ContextExecutor, iD int64, selectCols ...string) (*Port, error)

FindPort retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.

func (*Port) Delete

func (o *Port) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)

Delete deletes a single Port record with an executor. Delete will match against the primary key column to find the record to delete.

func (*Port) Insert

func (o *Port) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error

Insert a single record using an executor. See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts.

func (*Port) PortScan

func (o *Port) PortScan(mods ...qm.QueryMod) portScanQuery

PortScan pointed to by the foreign key.

func (*Port) Reload

func (o *Port) Reload(ctx context.Context, exec boil.ContextExecutor) error

Reload refetches the object from the database using the primary keys with an executor.

func (*Port) SetPortScan

func (o *Port) SetPortScan(ctx context.Context, exec boil.ContextExecutor, insert bool, related *PortScan) error

SetPortScan of the port to the related item. Sets o.R.PortScan to related. Adds o to related.R.Ports.

func (*Port) Update

func (o *Port) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)

Update uses an executor to update the Port. See boil.Columns.UpdateColumnSet documentation to understand column list inference for updates. Update does not automatically update the record in case of default values. Use .Reload() to refresh the records.

type PortHook

type PortHook func(context.Context, boil.ContextExecutor, *Port) error

PortHook is the signature for custom Port hook methods

type PortScan

type PortScan struct {
	ID        int64     `boil:"id" json:"id" toml:"id" yaml:"id"`
	CreatedAt time.Time `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"`
	Done      int64     `boil:"done" json:"done" toml:"done" yaml:"done"`
	NodeID    int64     `boil:"node_id" json:"node_id" toml:"node_id" yaml:"node_id"`

	R *portScanR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L portScanL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

PortScan is an object representing the database table.

func FindPortScan

func FindPortScan(ctx context.Context, exec boil.ContextExecutor, iD int64, selectCols ...string) (*PortScan, error)

FindPortScan retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.

func (*PortScan) AddPorts

func (o *PortScan) AddPorts(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Port) error

AddPorts adds the given related objects to the existing relationships of the port_scan, optionally inserting them as new records. Appends related to o.R.Ports. Sets related.R.PortScan appropriately.

func (*PortScan) Delete

func (o *PortScan) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)

Delete deletes a single PortScan record with an executor. Delete will match against the primary key column to find the record to delete.

func (*PortScan) Insert

func (o *PortScan) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error

Insert a single record using an executor. See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts.

func (*PortScan) Node

func (o *PortScan) Node(mods ...qm.QueryMod) nodeQuery

Node pointed to by the foreign key.

func (*PortScan) Ports

func (o *PortScan) Ports(mods ...qm.QueryMod) portQuery

Ports retrieves all the port's Ports with an executor.

func (*PortScan) Reload

func (o *PortScan) Reload(ctx context.Context, exec boil.ContextExecutor) error

Reload refetches the object from the database using the primary keys with an executor.

func (*PortScan) SetNode

func (o *PortScan) SetNode(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Node) error

SetNode of the portScan to the related item. Sets o.R.Node to related. Adds o to related.R.PortScans.

func (*PortScan) Update

func (o *PortScan) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)

Update uses an executor to update the PortScan. See boil.Columns.UpdateColumnSet documentation to understand column list inference for updates. Update does not automatically update the record in case of default values. Use .Reload() to refresh the records.

type PortScanHook

type PortScanHook func(context.Context, boil.ContextExecutor, *PortScan) error

PortScanHook is the signature for custom PortScan hook methods

type PortScanSlice

type PortScanSlice []*PortScan

PortScanSlice is an alias for a slice of pointers to PortScan. This should generally be used opposed to []PortScan.

func (PortScanSlice) DeleteAll

func (o PortScanSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error)

DeleteAll deletes all rows in the slice, using an executor.

func (*PortScanSlice) ReloadAll

func (o *PortScanSlice) ReloadAll(ctx context.Context, exec boil.ContextExecutor) error

ReloadAll refetches every row with matching primary key column values and overwrites the original object slice with the newly updated slice.

func (PortScanSlice) UpdateAll

func (o PortScanSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error)

UpdateAll updates all rows with the specified column values, using an executor.

type PortSlice

type PortSlice []*Port

PortSlice is an alias for a slice of pointers to Port. This should generally be used opposed to []Port.

func (PortSlice) DeleteAll

func (o PortSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error)

DeleteAll deletes all rows in the slice, using an executor.

func (*PortSlice) ReloadAll

func (o *PortSlice) ReloadAll(ctx context.Context, exec boil.ContextExecutor) error

ReloadAll refetches every row with matching primary key column values and overwrites the original object slice with the newly updated slice.

func (PortSlice) UpdateAll

func (o PortSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error)

UpdateAll updates all rows with the specified column values, using an executor.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL