models

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2023 License: GPL-3.0 Imports: 17 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 GooseDBVersionColumns = struct {
	ID        string
	VersionID string
	IsApplied string
	Tstamp    string
}{
	ID:        "id",
	VersionID: "version_id",
	IsApplied: "is_applied",
	Tstamp:    "tstamp",
}
View Source
var GooseDBVersionRels = struct {
}{}

GooseDBVersionRels is where relationship names are stored.

View Source
var GooseDBVersionTableColumns = struct {
	ID        string
	VersionID string
	IsApplied string
	Tstamp    string
}{
	ID:        "goose_db_version.id",
	VersionID: "goose_db_version.version_id",
	IsApplied: "goose_db_version.is_applied",
	Tstamp:    "goose_db_version.tstamp",
}
View Source
var GooseDBVersionWhere = struct {
	ID        whereHelpernull_Int64
	VersionID whereHelperint64
	IsApplied whereHelperint64
	Tstamp    whereHelpernull_String
}{
	ID:        whereHelpernull_Int64{/* contains filtered or unexported fields */},
	VersionID: whereHelperint64{/* contains filtered or unexported fields */},
	IsApplied: whereHelperint64{/* contains filtered or unexported fields */},
	Tstamp:    whereHelpernull_String{/* contains filtered or unexported fields */},
}
View Source
var PackageColumns = struct {
	ID             string
	Name           string
	Duration       string
	Price          string
	TrafficAllowed string
	ResetMode      string
	Active         string
}{
	ID:             "id",
	Name:           "name",
	Duration:       "duration",
	Price:          "price",
	TrafficAllowed: "traffic_allowed",
	ResetMode:      "reset_mode",
	Active:         "active",
}
View Source
var PackageRels = struct {
	Tusers string
}{
	Tusers: "Tusers",
}

PackageRels is where relationship names are stored.

View Source
var PackageTableColumns = struct {
	ID             string
	Name           string
	Duration       string
	Price          string
	TrafficAllowed string
	ResetMode      string
	Active         string
}{
	ID:             "package.id",
	Name:           "package.name",
	Duration:       "package.duration",
	Price:          "package.price",
	TrafficAllowed: "package.traffic_allowed",
	ResetMode:      "package.reset_mode",
	Active:         "package.active",
}
View Source
var PackageWhere = struct {
	ID             whereHelperint64
	Name           whereHelperstring
	Duration       whereHelperint64
	Price          whereHelperint64
	TrafficAllowed whereHelperfloat32
	ResetMode      whereHelperstring
	Active         whereHelpernull_Bool
}{
	ID:             whereHelperint64{/* contains filtered or unexported fields */},
	Name:           whereHelperstring{/* contains filtered or unexported fields */},
	Duration:       whereHelperint64{/* contains filtered or unexported fields */},
	Price:          whereHelperint64{/* contains filtered or unexported fields */},
	TrafficAllowed: whereHelperfloat32{/* contains filtered or unexported fields */},
	ResetMode:      whereHelperstring{/* contains filtered or unexported fields */},
	Active:         whereHelpernull_Bool{/* contains filtered or unexported fields */},
}
View Source
var TableNames = struct {
	GooseDBVersion string
	Package        string
	Tuser          string
	Xnode          string
}{
	GooseDBVersion: "goose_db_version",
	Package:        "package",
	Tuser:          "tuser",
	Xnode:          "xnode",
}
View Source
var TuserColumns = struct {
	ID                string
	Tid               string
	Username          string
	UUID              string
	Active            string
	AddedToNodesCount string
	TrafficUsage      string
	ExpireAt          string
	PackageID         string
}{
	ID:                "id",
	Tid:               "tid",
	Username:          "username",
	UUID:              "uuid",
	Active:            "active",
	AddedToNodesCount: "added_to_nodes_count",
	TrafficUsage:      "traffic_usage",
	ExpireAt:          "expire_at",
	PackageID:         "package_id",
}
View Source
var TuserRels = struct {
	Package string
}{
	Package: "Package",
}

TuserRels is where relationship names are stored.

View Source
var TuserTableColumns = struct {
	ID                string
	Tid               string
	Username          string
	UUID              string
	Active            string
	AddedToNodesCount string
	TrafficUsage      string
	ExpireAt          string
	PackageID         string
}{
	ID:                "tuser.id",
	Tid:               "tuser.tid",
	Username:          "tuser.username",
	UUID:              "tuser.uuid",
	Active:            "tuser.active",
	AddedToNodesCount: "tuser.added_to_nodes_count",
	TrafficUsage:      "tuser.traffic_usage",
	ExpireAt:          "tuser.expire_at",
	PackageID:         "tuser.package_id",
}
View Source
var TuserWhere = struct {
	ID                whereHelperint64
	Tid               whereHelperuint64
	Username          whereHelperstring
	UUID              whereHelperstring
	Active            whereHelperbool
	AddedToNodesCount whereHelperint64
	TrafficUsage      whereHelperfloat32
	ExpireAt          whereHelperstring
	PackageID         whereHelperint64
}{
	ID:                whereHelperint64{/* contains filtered or unexported fields */},
	Tid:               whereHelperuint64{/* contains filtered or unexported fields */},
	Username:          whereHelperstring{/* contains filtered or unexported fields */},
	UUID:              whereHelperstring{/* contains filtered or unexported fields */},
	Active:            whereHelperbool{/* contains filtered or unexported fields */},
	AddedToNodesCount: whereHelperint64{/* contains filtered or unexported fields */},
	TrafficUsage:      whereHelperfloat32{/* contains filtered or unexported fields */},
	ExpireAt:          whereHelperstring{/* contains filtered or unexported fields */},
	PackageID:         whereHelperint64{/* contains filtered or unexported fields */},
}
View Source
var ViewNames = struct {
}{}
View Source
var XnodeColumns = struct {
	ID        string
	Address   string
	PanelType string
	Active    string
}{
	ID:        "id",
	Address:   "address",
	PanelType: "panel_type",
	Active:    "active",
}
View Source
var XnodeRels = struct {
}{}

XnodeRels is where relationship names are stored.

View Source
var XnodeTableColumns = struct {
	ID        string
	Address   string
	PanelType string
	Active    string
}{
	ID:        "xnode.id",
	Address:   "xnode.address",
	PanelType: "xnode.panel_type",
	Active:    "xnode.active",
}
View Source
var XnodeWhere = struct {
	ID        whereHelperint64
	Address   whereHelperstring
	PanelType whereHelperstring
	Active    whereHelpernull_Bool
}{
	ID:        whereHelperint64{/* contains filtered or unexported fields */},
	Address:   whereHelperstring{/* contains filtered or unexported fields */},
	PanelType: whereHelperstring{/* contains filtered or unexported fields */},
	Active:    whereHelpernull_Bool{/* contains filtered or unexported fields */},
}

Functions

func AddGooseDBVersionHook

func AddGooseDBVersionHook(hookPoint boil.HookPoint, gooseDBVersionHook GooseDBVersionHook)

AddGooseDBVersionHook registers your hook function for all future operations.

func AddPackageHook

func AddPackageHook(hookPoint boil.HookPoint, packageHook PackageHook)

AddPackageHook registers your hook function for all future operations.

func AddTuserHook

func AddTuserHook(hookPoint boil.HookPoint, tuserHook TuserHook)

AddTuserHook registers your hook function for all future operations.

func AddXnodeHook

func AddXnodeHook(hookPoint boil.HookPoint, xnodeHook XnodeHook)

AddXnodeHook registers your hook function for all future operations.

func GooseDBVersionExists

func GooseDBVersionExists(ctx context.Context, exec boil.ContextExecutor, iD null.Int64) (bool, error)

GooseDBVersionExists checks if the GooseDBVersion row exists.

func GooseDBVersions

func GooseDBVersions(mods ...qm.QueryMod) gooseDBVersionQuery

GooseDBVersions 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 PackageExists

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

PackageExists checks if the Package row exists.

func Packages

func Packages(mods ...qm.QueryMod) packageQuery

Packages retrieves all the records using an executor.

func TuserExists

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

TuserExists checks if the Tuser row exists.

func Tusers

func Tusers(mods ...qm.QueryMod) tuserQuery

Tusers retrieves all the records using an executor.

func XnodeExists

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

XnodeExists checks if the Xnode row exists.

func Xnodes

func Xnodes(mods ...qm.QueryMod) xnodeQuery

Xnodes retrieves all the records using an executor.

Types

type GooseDBVersion

type GooseDBVersion struct {
	ID        null.Int64  `boil:"id" json:"id,omitempty" toml:"id" yaml:"id,omitempty"`
	VersionID int64       `boil:"version_id" json:"version_id" toml:"version_id" yaml:"version_id"`
	IsApplied int64       `boil:"is_applied" json:"is_applied" toml:"is_applied" yaml:"is_applied"`
	Tstamp    null.String `boil:"tstamp" json:"tstamp,omitempty" toml:"tstamp" yaml:"tstamp,omitempty"`

	R *gooseDBVersionR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L gooseDBVersionL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

GooseDBVersion is an object representing the database table.

func FindGooseDBVersion

func FindGooseDBVersion(ctx context.Context, exec boil.ContextExecutor, iD null.Int64, selectCols ...string) (*GooseDBVersion, error)

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

func (*GooseDBVersion) Delete

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

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

func (*GooseDBVersion) Exists

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

Exists checks if the GooseDBVersion row exists.

func (*GooseDBVersion) Insert

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

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

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

func (*GooseDBVersion) Update

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

Update uses an executor to update the GooseDBVersion. 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 (*GooseDBVersion) Upsert

func (o *GooseDBVersion) 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 GooseDBVersionHook

type GooseDBVersionHook func(context.Context, boil.ContextExecutor, *GooseDBVersion) error

GooseDBVersionHook is the signature for custom GooseDBVersion hook methods

type GooseDBVersionSlice

type GooseDBVersionSlice []*GooseDBVersion

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

func (GooseDBVersionSlice) DeleteAll

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

func (*GooseDBVersionSlice) ReloadAll

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

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

type Package struct {
	ID             int64     `boil:"id" json:"id" toml:"id" yaml:"id"`
	Name           string    `boil:"name" json:"name" toml:"name" yaml:"name"`
	Duration       int64     `boil:"duration" json:"duration" toml:"duration" yaml:"duration"`
	Price          int64     `boil:"price" json:"price" toml:"price" yaml:"price"`
	TrafficAllowed float32   `boil:"traffic_allowed" json:"traffic_allowed" toml:"traffic_allowed" yaml:"traffic_allowed"`
	ResetMode      string    `boil:"reset_mode" json:"reset_mode" toml:"reset_mode" yaml:"reset_mode"`
	Active         null.Bool `boil:"active" json:"active,omitempty" toml:"active" yaml:"active,omitempty"`

	R *packageR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L packageL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Package is an object representing the database table.

func FindPackage

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

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

func (*Package) AddTusers

func (o *Package) AddTusers(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Tuser) error

AddTusers adds the given related objects to the existing relationships of the package, optionally inserting them as new records. Appends related to o.R.Tusers. Sets related.R.Package appropriately.

func (*Package) Delete

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

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

func (*Package) Exists

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

Exists checks if the Package row exists.

func (*Package) Insert

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

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

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

func (*Package) Tusers

func (o *Package) Tusers(mods ...qm.QueryMod) tuserQuery

Tusers retrieves all the tuser's Tusers with an executor.

func (*Package) Update

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

Update uses an executor to update the Package. 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 (*Package) Upsert

func (o *Package) 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 PackageHook

type PackageHook func(context.Context, boil.ContextExecutor, *Package) error

PackageHook is the signature for custom Package hook methods

type PackageSlice

type PackageSlice []*Package

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

func (PackageSlice) DeleteAll

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

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

func (*PackageSlice) ReloadAll

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

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

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

type Tuser

type Tuser struct {
	ID                int64   `boil:"id" json:"id" toml:"id" yaml:"id"`
	Tid               uint64  `boil:"tid" json:"tid" toml:"tid" yaml:"tid"`
	Username          string  `boil:"username" json:"username" toml:"username" yaml:"username"`
	UUID              string  `boil:"uuid" json:"uuid" toml:"uuid" yaml:"uuid"`
	Active            bool    `boil:"active" json:"active" toml:"active" yaml:"active"`
	AddedToNodesCount int64   `boil:"added_to_nodes_count" json:"added_to_nodes_count" toml:"added_to_nodes_count" yaml:"added_to_nodes_count"`
	TrafficUsage      float32 `boil:"traffic_usage" json:"traffic_usage" toml:"traffic_usage" yaml:"traffic_usage"`
	ExpireAt          string  `boil:"expire_at" json:"expire_at" toml:"expire_at" yaml:"expire_at"`
	PackageID         int64   `boil:"package_id" json:"package_id" toml:"package_id" yaml:"package_id"`

	R *tuserR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L tuserL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Tuser is an object representing the database table.

func FindTuser

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

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

func (*Tuser) Delete

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

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

func (*Tuser) Exists

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

Exists checks if the Tuser row exists.

func (*Tuser) Insert

func (o *Tuser) 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 (*Tuser) Package

func (o *Tuser) Package(mods ...qm.QueryMod) packageQuery

Package pointed to by the foreign key.

func (*Tuser) Reload

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

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

func (*Tuser) SetPackage

func (o *Tuser) SetPackage(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Package) error

SetPackage of the tuser to the related item. Sets o.R.Package to related. Adds o to related.R.Tusers.

func (*Tuser) Update

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

Update uses an executor to update the Tuser. 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 (*Tuser) Upsert

func (o *Tuser) 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 TuserHook

type TuserHook func(context.Context, boil.ContextExecutor, *Tuser) error

TuserHook is the signature for custom Tuser hook methods

type TuserSlice

type TuserSlice []*Tuser

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

func (TuserSlice) DeleteAll

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

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

func (*TuserSlice) ReloadAll

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

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

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

type Xnode

type Xnode struct {
	ID        int64     `boil:"id" json:"id" toml:"id" yaml:"id"`
	Address   string    `boil:"address" json:"address" toml:"address" yaml:"address"`
	PanelType string    `boil:"panel_type" json:"panel_type" toml:"panel_type" yaml:"panel_type"`
	Active    null.Bool `boil:"active" json:"active,omitempty" toml:"active" yaml:"active,omitempty"`

	R *xnodeR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L xnodeL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Xnode is an object representing the database table.

func FindXnode

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

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

func (*Xnode) Delete

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

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

func (*Xnode) Exists

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

Exists checks if the Xnode row exists.

func (*Xnode) Insert

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

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

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

func (*Xnode) Update

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

Update uses an executor to update the Xnode. 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 (*Xnode) Upsert

func (o *Xnode) 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 XnodeHook

type XnodeHook func(context.Context, boil.ContextExecutor, *Xnode) error

XnodeHook is the signature for custom Xnode hook methods

type XnodeSlice

type XnodeSlice []*Xnode

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

func (XnodeSlice) DeleteAll

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

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

func (*XnodeSlice) ReloadAll

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

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