models

package
v0.0.0-...-f34edaa Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: MIT 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 HostColumns = struct {
	ID       string
	Hostname string
	Ipaddr   string
	Zone     string
	Desc     string
}{
	ID:       "id",
	Hostname: "hostname",
	Ipaddr:   "ipaddr",
	Zone:     "zone",
	Desc:     "desc",
}
View Source
var HostRels = struct {
}{}

HostRels is where relationship names are stored.

View Source
var HostSgroupColumns = struct {
	HostID   string
	SgroupID string
}{
	HostID:   "host_id",
	SgroupID: "sgroup_id",
}
View Source
var HostSgroupRels = struct {
}{}

HostSgroupRels is where relationship names are stored.

View Source
var HostSgroupTableColumns = struct {
	HostID   string
	SgroupID string
}{
	HostID:   "host_sgroup.host_id",
	SgroupID: "host_sgroup.sgroup_id",
}
View Source
var HostSgroupWhere = struct {
	HostID   whereHelperint64
	SgroupID whereHelperint64
}{
	HostID:   whereHelperint64{/* contains filtered or unexported fields */},
	SgroupID: whereHelperint64{/* contains filtered or unexported fields */},
}
View Source
var HostTableColumns = struct {
	ID       string
	Hostname string
	Ipaddr   string
	Zone     string
	Desc     string
}{
	ID:       "host.id",
	Hostname: "host.hostname",
	Ipaddr:   "host.ipaddr",
	Zone:     "host.zone",
	Desc:     "host.desc",
}
View Source
var HostWhere = struct {
	ID       whereHelperint64
	Hostname whereHelperstring
	Ipaddr   whereHelperstring
	Zone     whereHelperstring
	Desc     whereHelperstring
}{
	ID:       whereHelperint64{/* contains filtered or unexported fields */},
	Hostname: whereHelperstring{/* contains filtered or unexported fields */},
	Ipaddr:   whereHelperstring{/* contains filtered or unexported fields */},
	Zone:     whereHelperstring{/* contains filtered or unexported fields */},
	Desc:     whereHelperstring{/* contains filtered or unexported fields */},
}
View Source
var PolicyColumns = struct {
	SRC      string
	DST      string
	Port     string
	Protocol string
	Desc     string
}{
	SRC:      "src",
	DST:      "dst",
	Port:     "port",
	Protocol: "protocol",
	Desc:     "desc",
}
View Source
var PolicyRels = struct {
}{}

PolicyRels is where relationship names are stored.

View Source
var PolicyTableColumns = struct {
	SRC      string
	DST      string
	Port     string
	Protocol string
	Desc     string
}{
	SRC:      "policy.src",
	DST:      "policy.dst",
	Port:     "policy.port",
	Protocol: "policy.protocol",
	Desc:     "policy.desc",
}
View Source
var PolicyWhere = struct {
	SRC      whereHelperint64
	DST      whereHelperint64
	Port     whereHelperint64
	Protocol whereHelperstring
	Desc     whereHelperstring
}{
	SRC:      whereHelperint64{/* contains filtered or unexported fields */},
	DST:      whereHelperint64{/* contains filtered or unexported fields */},
	Port:     whereHelperint64{/* contains filtered or unexported fields */},
	Protocol: whereHelperstring{/* contains filtered or unexported fields */},
	Desc:     whereHelperstring{/* contains filtered or unexported fields */},
}
View Source
var SgroupColumns = struct {
	ID     string
	Name   string
	Ipaddr string
	Zone   string
	Desc   string
}{
	ID:     "id",
	Name:   "name",
	Ipaddr: "ipaddr",
	Zone:   "zone",
	Desc:   "desc",
}
View Source
var SgroupRels = struct {
}{}

SgroupRels is where relationship names are stored.

View Source
var SgroupTableColumns = struct {
	ID     string
	Name   string
	Ipaddr string
	Zone   string
	Desc   string
}{
	ID:     "sgroup.id",
	Name:   "sgroup.name",
	Ipaddr: "sgroup.ipaddr",
	Zone:   "sgroup.zone",
	Desc:   "sgroup.desc",
}
View Source
var SgroupWhere = struct {
	ID     whereHelperint64
	Name   whereHelperstring
	Ipaddr whereHelperstring
	Zone   whereHelperstring
	Desc   whereHelperstring
}{
	ID:     whereHelperint64{/* contains filtered or unexported fields */},
	Name:   whereHelperstring{/* contains filtered or unexported fields */},
	Ipaddr: whereHelperstring{/* contains filtered or unexported fields */},
	Zone:   whereHelperstring{/* contains filtered or unexported fields */},
	Desc:   whereHelperstring{/* contains filtered or unexported fields */},
}
View Source
var TableNames = struct {
	Host       string
	HostSgroup string
	Policy     string
	Sgroup     string
}{
	Host:       "host",
	HostSgroup: "host_sgroup",
	Policy:     "policy",
	Sgroup:     "sgroup",
}
View Source
var ViewNames = struct {
}{}

Functions

func AddHostHook

func AddHostHook(hookPoint boil.HookPoint, hostHook HostHook)

AddHostHook registers your hook function for all future operations.

func AddHostSgroupHook

func AddHostSgroupHook(hookPoint boil.HookPoint, hostSgroupHook HostSgroupHook)

AddHostSgroupHook registers your hook function for all future operations.

func AddPolicyHook

func AddPolicyHook(hookPoint boil.HookPoint, policyHook PolicyHook)

AddPolicyHook registers your hook function for all future operations.

func AddSgroupHook

func AddSgroupHook(hookPoint boil.HookPoint, sgroupHook SgroupHook)

AddSgroupHook registers your hook function for all future operations.

func HostExists

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

HostExists checks if the Host row exists.

func HostSgroupExists

func HostSgroupExists(ctx context.Context, exec boil.ContextExecutor, hostID int64, sgroupID int64) (bool, error)

HostSgroupExists checks if the HostSgroup row exists.

func HostSgroups

func HostSgroups(mods ...qm.QueryMod) hostSgroupQuery

HostSgroups retrieves all the records using an executor.

func Hosts

func Hosts(mods ...qm.QueryMod) hostQuery

Hosts 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 Policies

func Policies(mods ...qm.QueryMod) policyQuery

Policies retrieves all the records using an executor.

func PolicyExists

func PolicyExists(ctx context.Context, exec boil.ContextExecutor, sRC int64, dST int64, port int64, protocol string) (bool, error)

PolicyExists checks if the Policy row exists.

func SgroupExists

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

SgroupExists checks if the Sgroup row exists.

func Sgroups

func Sgroups(mods ...qm.QueryMod) sgroupQuery

Sgroups retrieves all the records using an executor.

Types

type Host

type Host struct {
	ID       int64  `boil:"id" json:"id" toml:"id" yaml:"id"`
	Hostname string `boil:"hostname" json:"hostname" toml:"hostname" yaml:"hostname"`
	Ipaddr   string `boil:"ipaddr" json:"ipaddr" toml:"ipaddr" yaml:"ipaddr"`
	Zone     string `boil:"zone" json:"zone" toml:"zone" yaml:"zone"`
	Desc     string `boil:"desc" json:"desc" toml:"desc" yaml:"desc"`

	R *hostR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L hostL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Host is an object representing the database table.

func FindHost

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

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

func (*Host) Delete

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

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

func (*Host) Exists

func (o *Host) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error)

Exists checks if the Host row exists.

func (*Host) Insert

func (o *Host) 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 (*Host) Reload

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

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

func (*Host) Update

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

Update uses an executor to update the Host. 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.

func (*Host) Upsert

func (o *Host) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns) error

Upsert attempts an insert using an executor, and does an update or ignore on conflict. See boil.Columns documentation for how to properly use updateColumns and insertColumns.

type HostHook

type HostHook func(context.Context, boil.ContextExecutor, *Host) error

HostHook is the signature for custom Host hook methods

type HostSgroup

type HostSgroup struct {
	HostID   int64 `boil:"host_id" json:"host_id" toml:"host_id" yaml:"host_id"`
	SgroupID int64 `boil:"sgroup_id" json:"sgroup_id" toml:"sgroup_id" yaml:"sgroup_id"`

	R *hostSgroupR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L hostSgroupL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

HostSgroup is an object representing the database table.

func FindHostSgroup

func FindHostSgroup(ctx context.Context, exec boil.ContextExecutor, hostID int64, sgroupID int64, selectCols ...string) (*HostSgroup, error)

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

func (*HostSgroup) Delete

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

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

func (*HostSgroup) Exists

func (o *HostSgroup) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error)

Exists checks if the HostSgroup row exists.

func (*HostSgroup) Insert

func (o *HostSgroup) 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 (*HostSgroup) Reload

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

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

func (*HostSgroup) Update

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

Update uses an executor to update the HostSgroup. 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.

func (*HostSgroup) Upsert

func (o *HostSgroup) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns) error

Upsert attempts an insert using an executor, and does an update or ignore on conflict. See boil.Columns documentation for how to properly use updateColumns and insertColumns.

type HostSgroupHook

type HostSgroupHook func(context.Context, boil.ContextExecutor, *HostSgroup) error

HostSgroupHook is the signature for custom HostSgroup hook methods

type HostSgroupSlice

type HostSgroupSlice []*HostSgroup

HostSgroupSlice is an alias for a slice of pointers to HostSgroup. This should almost always be used instead of []HostSgroup.

func (HostSgroupSlice) DeleteAll

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

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

func (*HostSgroupSlice) ReloadAll

func (o *HostSgroupSlice) 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 (HostSgroupSlice) UpdateAll

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

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

type HostSlice

type HostSlice []*Host

HostSlice is an alias for a slice of pointers to Host. This should almost always be used instead of []Host.

func (HostSlice) DeleteAll

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

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

func (*HostSlice) ReloadAll

func (o *HostSlice) 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 (HostSlice) UpdateAll

func (o HostSlice) 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 Policy

type Policy struct {
	SRC      int64  `boil:"src" json:"src" toml:"src" yaml:"src"`
	DST      int64  `boil:"dst" json:"dst" toml:"dst" yaml:"dst"`
	Port     int64  `boil:"port" json:"port" toml:"port" yaml:"port"`
	Protocol string `boil:"protocol" json:"protocol" toml:"protocol" yaml:"protocol"`
	Desc     string `boil:"desc" json:"desc" toml:"desc" yaml:"desc"`

	R *policyR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L policyL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Policy is an object representing the database table.

func FindPolicy

func FindPolicy(ctx context.Context, exec boil.ContextExecutor, sRC int64, dST int64, port int64, protocol string, selectCols ...string) (*Policy, error)

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

func (*Policy) Delete

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

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

func (*Policy) Exists

func (o *Policy) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error)

Exists checks if the Policy row exists.

func (*Policy) Insert

func (o *Policy) 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 (*Policy) Reload

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

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

func (*Policy) Update

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

Update uses an executor to update the Policy. 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.

func (*Policy) Upsert

func (o *Policy) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns) error

Upsert attempts an insert using an executor, and does an update or ignore on conflict. See boil.Columns documentation for how to properly use updateColumns and insertColumns.

type PolicyHook

type PolicyHook func(context.Context, boil.ContextExecutor, *Policy) error

PolicyHook is the signature for custom Policy hook methods

type PolicySlice

type PolicySlice []*Policy

PolicySlice is an alias for a slice of pointers to Policy. This should almost always be used instead of []Policy.

func (PolicySlice) DeleteAll

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

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

func (*PolicySlice) ReloadAll

func (o *PolicySlice) 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 (PolicySlice) UpdateAll

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

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

type Sgroup

type Sgroup struct {
	ID     int64  `boil:"id" json:"id" toml:"id" yaml:"id"`
	Name   string `boil:"name" json:"name" toml:"name" yaml:"name"`
	Ipaddr string `boil:"ipaddr" json:"ipaddr" toml:"ipaddr" yaml:"ipaddr"`
	Zone   string `boil:"zone" json:"zone" toml:"zone" yaml:"zone"`
	Desc   string `boil:"desc" json:"desc" toml:"desc" yaml:"desc"`

	R *sgroupR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L sgroupL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Sgroup is an object representing the database table.

func FindSgroup

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

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

func (*Sgroup) Delete

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

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

func (*Sgroup) Exists

func (o *Sgroup) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error)

Exists checks if the Sgroup row exists.

func (*Sgroup) Insert

func (o *Sgroup) 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 (*Sgroup) Reload

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

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

func (*Sgroup) Update

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

Update uses an executor to update the Sgroup. 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.

func (*Sgroup) Upsert

func (o *Sgroup) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns) error

Upsert attempts an insert using an executor, and does an update or ignore on conflict. See boil.Columns documentation for how to properly use updateColumns and insertColumns.

type SgroupHook

type SgroupHook func(context.Context, boil.ContextExecutor, *Sgroup) error

SgroupHook is the signature for custom Sgroup hook methods

type SgroupSlice

type SgroupSlice []*Sgroup

SgroupSlice is an alias for a slice of pointers to Sgroup. This should almost always be used instead of []Sgroup.

func (SgroupSlice) DeleteAll

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

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

func (*SgroupSlice) ReloadAll

func (o *SgroupSlice) 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 (SgroupSlice) UpdateAll

func (o SgroupSlice) 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