models

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: May 8, 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 KeyvalColumns = struct {
	ID    string
	Key   string
	Value string
}{
	ID:    "id",
	Key:   "key",
	Value: "value",
}
View Source
var KeyvalRels = struct {
}{}

KeyvalRels is where relationship names are stored.

View Source
var KeyvalTableColumns = struct {
	ID    string
	Key   string
	Value string
}{
	ID:    "keyval.id",
	Key:   "keyval.key",
	Value: "keyval.value",
}
View Source
var KeyvalWhere = struct {
	ID    whereHelperint64
	Key   whereHelperstring
	Value whereHelperstring
}{
	ID:    whereHelperint64{/* contains filtered or unexported fields */},
	Key:   whereHelperstring{/* contains filtered or unexported fields */},
	Value: whereHelperstring{/* contains filtered or unexported fields */},
}
View Source
var PackageColumns = struct {
	ID             string
	Name           string
	Duration       string
	Price          string
	TrafficAllowed string
	ResetMode      string
	Active         string
	Description    string
}{
	ID:             "id",
	Name:           "name",
	Duration:       "duration",
	Price:          "price",
	TrafficAllowed: "traffic_allowed",
	ResetMode:      "reset_mode",
	Active:         "active",
	Description:    "description",
}
View Source
var PackageRels = struct {
	Purchases string
	Tusers    string
}{
	Purchases: "Purchases",
	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
	Description    string
}{
	ID:             "package.id",
	Name:           "package.name",
	Duration:       "package.duration",
	Price:          "package.price",
	TrafficAllowed: "package.traffic_allowed",
	ResetMode:      "package.reset_mode",
	Active:         "package.active",
	Description:    "package.description",
}
View Source
var PackageWhere = struct {
	ID             whereHelperint64
	Name           whereHelperstring
	Duration       whereHelperint64
	Price          whereHelperint64
	TrafficAllowed whereHelperfloat32
	ResetMode      whereHelperstring
	Active         whereHelperbool
	Description    whereHelperstring
}{
	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:         whereHelperbool{/* contains filtered or unexported fields */},
	Description:    whereHelperstring{/* contains filtered or unexported fields */},
}
View Source
var PurchaseColumns = struct {
	ID            string
	TuserID       string
	PackageID     string
	Price         string
	PackageName   string
	Status        string
	ProcessedAt   string
	CreatedAt     string
	TransactionID string
	ShaparakRef   string
}{
	ID:            "id",
	TuserID:       "tuser_id",
	PackageID:     "package_id",
	Price:         "price",
	PackageName:   "package_name",
	Status:        "status",
	ProcessedAt:   "processed_at",
	CreatedAt:     "created_at",
	TransactionID: "transaction_id",
	ShaparakRef:   "shaparak_ref",
}
View Source
var PurchaseRels = struct {
	Package string
	Tuser   string
}{
	Package: "Package",
	Tuser:   "Tuser",
}

PurchaseRels is where relationship names are stored.

View Source
var PurchaseTableColumns = struct {
	ID            string
	TuserID       string
	PackageID     string
	Price         string
	PackageName   string
	Status        string
	ProcessedAt   string
	CreatedAt     string
	TransactionID string
	ShaparakRef   string
}{
	ID:            "purchase.id",
	TuserID:       "purchase.tuser_id",
	PackageID:     "purchase.package_id",
	Price:         "purchase.price",
	PackageName:   "purchase.package_name",
	Status:        "purchase.status",
	ProcessedAt:   "purchase.processed_at",
	CreatedAt:     "purchase.created_at",
	TransactionID: "purchase.transaction_id",
	ShaparakRef:   "purchase.shaparak_ref",
}
View Source
var PurchaseWhere = struct {
	ID            whereHelperint64
	TuserID       whereHelperint64
	PackageID     whereHelperint64
	Price         whereHelperint64
	PackageName   whereHelperstring
	Status        whereHelperint64
	ProcessedAt   whereHelpernull_Time
	CreatedAt     whereHelpertime_Time
	TransactionID whereHelpernull_String
	ShaparakRef   whereHelpernull_String
}{
	ID:            whereHelperint64{/* contains filtered or unexported fields */},
	TuserID:       whereHelperint64{/* contains filtered or unexported fields */},
	PackageID:     whereHelperint64{/* contains filtered or unexported fields */},
	Price:         whereHelperint64{/* contains filtered or unexported fields */},
	PackageName:   whereHelperstring{/* contains filtered or unexported fields */},
	Status:        whereHelperint64{/* contains filtered or unexported fields */},
	ProcessedAt:   whereHelpernull_Time{/* contains filtered or unexported fields */},
	CreatedAt:     whereHelpertime_Time{/* contains filtered or unexported fields */},
	TransactionID: whereHelpernull_String{/* contains filtered or unexported fields */},
	ShaparakRef:   whereHelpernull_String{/* contains filtered or unexported fields */},
}
View Source
var TableNames = struct {
	GooseDBVersion string
	Keyval         string
	Package        string
	Purchase       string
	Tuser          string
	Xnode          string
}{
	GooseDBVersion: "goose_db_version",
	Keyval:         "keyval",
	Package:        "package",
	Purchase:       "purchase",
	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
	Token             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",
	Token:             "token",
}
View Source
var TuserRels = struct {
	Package   string
	Purchases string
}{
	Package:   "Package",
	Purchases: "Purchases",
}

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
	Token             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",
	Token:             "tuser.token",
}
View Source
var TuserWhere = struct {
	ID                whereHelperint64
	Tid               whereHelperuint64
	Username          whereHelperstring
	UUID              whereHelperstring
	Active            whereHelperbool
	AddedToNodesCount whereHelperint64
	TrafficUsage      whereHelperfloat32
	ExpireAt          whereHelperstring
	PackageID         whereHelperint64
	Token             whereHelperstring
}{
	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 */},
	Token:             whereHelperstring{/* 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    whereHelperbool
}{
	ID:        whereHelperint64{/* contains filtered or unexported fields */},
	Address:   whereHelperstring{/* contains filtered or unexported fields */},
	PanelType: whereHelperstring{/* contains filtered or unexported fields */},
	Active:    whereHelperbool{/* 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 AddKeyvalHook added in v0.3.1

func AddKeyvalHook(hookPoint boil.HookPoint, keyvalHook KeyvalHook)

AddKeyvalHook 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 AddPurchaseHook added in v0.3.1

func AddPurchaseHook(hookPoint boil.HookPoint, purchaseHook PurchaseHook)

AddPurchaseHook 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 KeyvalExists added in v0.3.1

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

KeyvalExists checks if the Keyval row exists.

func Keyvals added in v0.3.1

func Keyvals(mods ...qm.QueryMod) keyvalQuery

Keyvals 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 PurchaseExists added in v0.3.1

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

PurchaseExists checks if the Purchase row exists.

func Purchases added in v0.3.1

func Purchases(mods ...qm.QueryMod) purchaseQuery

Purchases 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 Keyval added in v0.3.1

type Keyval struct {
	ID    int64  `boil:"id" json:"id" toml:"id" yaml:"id"`
	Key   string `boil:"key" json:"key" toml:"key" yaml:"key"`
	Value string `boil:"value" json:"value" toml:"value" yaml:"value"`

	R *keyvalR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L keyvalL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Keyval is an object representing the database table.

func FindKeyval added in v0.3.1

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

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

func (*Keyval) Delete added in v0.3.1

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

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

func (*Keyval) Exists added in v0.3.1

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

Exists checks if the Keyval row exists.

func (*Keyval) Insert added in v0.3.1

func (o *Keyval) 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 (*Keyval) Reload added in v0.3.1

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

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

func (*Keyval) Update added in v0.3.1

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

Update uses an executor to update the Keyval. 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 (*Keyval) Upsert added in v0.3.1

func (o *Keyval) 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 KeyvalHook added in v0.3.1

type KeyvalHook func(context.Context, boil.ContextExecutor, *Keyval) error

KeyvalHook is the signature for custom Keyval hook methods

type KeyvalSlice added in v0.3.1

type KeyvalSlice []*Keyval

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

func (KeyvalSlice) DeleteAll added in v0.3.1

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

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

func (*KeyvalSlice) ReloadAll added in v0.3.1

func (o *KeyvalSlice) 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 (KeyvalSlice) UpdateAll added in v0.3.1

func (o KeyvalSlice) 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         bool    `boil:"active" json:"active" toml:"active" yaml:"active"`
	Description    string  `boil:"description" json:"description" toml:"description" yaml:"description"`

	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) AddPurchases added in v0.3.1

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

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

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) Purchases added in v0.3.1

func (o *Package) Purchases(mods ...qm.QueryMod) purchaseQuery

Purchases retrieves all the purchase's Purchases with an executor.

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 Purchase added in v0.3.1

type Purchase struct {
	ID            int64       `boil:"id" json:"id" toml:"id" yaml:"id"`
	TuserID       int64       `boil:"tuser_id" json:"tuser_id" toml:"tuser_id" yaml:"tuser_id"`
	PackageID     int64       `boil:"package_id" json:"package_id" toml:"package_id" yaml:"package_id"`
	Price         int64       `boil:"price" json:"price" toml:"price" yaml:"price"`
	PackageName   string      `boil:"package_name" json:"package_name" toml:"package_name" yaml:"package_name"`
	Status        int64       `boil:"status" json:"status" toml:"status" yaml:"status"`
	ProcessedAt   null.Time   `boil:"processed_at" json:"processed_at,omitempty" toml:"processed_at" yaml:"processed_at,omitempty"`
	CreatedAt     time.Time   `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"`
	TransactionID null.String `boil:"transaction_id" json:"transaction_id,omitempty" toml:"transaction_id" yaml:"transaction_id,omitempty"`
	ShaparakRef   null.String `boil:"shaparak_ref" json:"shaparak_ref,omitempty" toml:"shaparak_ref" yaml:"shaparak_ref,omitempty"`

	R *purchaseR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L purchaseL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Purchase is an object representing the database table.

func FindPurchase added in v0.3.1

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

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

func (*Purchase) Delete added in v0.3.1

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

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

func (*Purchase) Exists added in v0.3.1

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

Exists checks if the Purchase row exists.

func (*Purchase) Insert added in v0.3.1

func (o *Purchase) 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 (*Purchase) Package added in v0.3.1

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

Package pointed to by the foreign key.

func (*Purchase) Reload added in v0.3.1

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

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

func (*Purchase) SetPackage added in v0.3.1

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

SetPackage of the purchase to the related item. Sets o.R.Package to related. Adds o to related.R.Purchases.

func (*Purchase) SetTuser added in v0.3.1

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

SetTuser of the purchase to the related item. Sets o.R.Tuser to related. Adds o to related.R.Purchases.

func (*Purchase) Tuser added in v0.3.1

func (o *Purchase) Tuser(mods ...qm.QueryMod) tuserQuery

Tuser pointed to by the foreign key.

func (*Purchase) Update added in v0.3.1

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

Update uses an executor to update the Purchase. 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 (*Purchase) Upsert added in v0.3.1

func (o *Purchase) 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 PurchaseHook added in v0.3.1

type PurchaseHook func(context.Context, boil.ContextExecutor, *Purchase) error

PurchaseHook is the signature for custom Purchase hook methods

type PurchaseSlice added in v0.3.1

type PurchaseSlice []*Purchase

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

func (PurchaseSlice) DeleteAll added in v0.3.1

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

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

func (*PurchaseSlice) ReloadAll added in v0.3.1

func (o *PurchaseSlice) 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 (PurchaseSlice) UpdateAll added in v0.3.1

func (o PurchaseSlice) 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"`
	Token             string  `boil:"token" json:"token" toml:"token" yaml:"token"`

	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) AddPurchases added in v0.3.1

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

AddPurchases adds the given related objects to the existing relationships of the tuser, optionally inserting them as new records. Appends related to o.R.Purchases. Sets related.R.Tuser appropriately.

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) Purchases added in v0.3.1

func (o *Tuser) Purchases(mods ...qm.QueryMod) purchaseQuery

Purchases retrieves all the purchase's Purchases with an executor.

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    bool   `boil:"active" json:"active" toml:"active" yaml:"active"`

	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