models

package
v0.0.0-...-04a098d Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2019 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AccountColumns = struct {
	ID        string
	CreatedAt string
	UpdatedAt string
	Name      string
	Provider  string
	Token     string
	UserID    string
}{
	ID:        "id",
	CreatedAt: "created_at",
	UpdatedAt: "updated_at",
	Name:      "name",
	Provider:  "provider",
	Token:     "token",
	UserID:    "user_id",
}
View Source
var AccountRels = struct {
	User      string
	SnapRules string
}{
	User:      "User",
	SnapRules: "SnapRules",
}

AccountRels is where relationship names are stored.

View Source
var AccountWhere = struct {
	ID        whereHelperint
	CreatedAt whereHelpernull_Time
	UpdatedAt whereHelpernull_Time
	Name      whereHelperstring
	Provider  whereHelperstring
	Token     whereHelperstring
	UserID    whereHelperint
}{
	ID:        whereHelperint{/* contains filtered or unexported fields */},
	CreatedAt: whereHelpernull_Time{/* contains filtered or unexported fields */},
	UpdatedAt: whereHelpernull_Time{/* contains filtered or unexported fields */},
	Name:      whereHelperstring{/* contains filtered or unexported fields */},
	Provider:  whereHelperstring{/* contains filtered or unexported fields */},
	Token:     whereHelperstring{/* contains filtered or unexported fields */},
	UserID:    whereHelperint{/* contains filtered or unexported fields */},
}
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 SnapRuleColumns = struct {
	ID                 string
	CreatedAt          string
	UpdatedAt          string
	Frequency          string
	VolumeID           string
	VolumeName         string
	VolumeRegion       string
	AccountID          string
	VolumeOrganization string
}{
	ID:                 "id",
	CreatedAt:          "created_at",
	UpdatedAt:          "updated_at",
	Frequency:          "frequency",
	VolumeID:           "volume_id",
	VolumeName:         "volume_name",
	VolumeRegion:       "volume_region",
	AccountID:          "account_id",
	VolumeOrganization: "volume_organization",
}
View Source
var SnapRuleRels = struct {
	Account   string
	Snapshots string
}{
	Account:   "Account",
	Snapshots: "Snapshots",
}

SnapRuleRels is where relationship names are stored.

View Source
var SnapRuleWhere = struct {
	ID                 whereHelperint
	CreatedAt          whereHelpernull_Time
	UpdatedAt          whereHelpernull_Time
	Frequency          whereHelperint
	VolumeID           whereHelperstring
	VolumeName         whereHelperstring
	VolumeRegion       whereHelperstring
	AccountID          whereHelperint
	VolumeOrganization whereHelperstring
}{
	ID:                 whereHelperint{/* contains filtered or unexported fields */},
	CreatedAt:          whereHelpernull_Time{/* contains filtered or unexported fields */},
	UpdatedAt:          whereHelpernull_Time{/* contains filtered or unexported fields */},
	Frequency:          whereHelperint{/* contains filtered or unexported fields */},
	VolumeID:           whereHelperstring{/* contains filtered or unexported fields */},
	VolumeName:         whereHelperstring{/* contains filtered or unexported fields */},
	VolumeRegion:       whereHelperstring{/* contains filtered or unexported fields */},
	AccountID:          whereHelperint{/* contains filtered or unexported fields */},
	VolumeOrganization: whereHelperstring{/* contains filtered or unexported fields */},
}
View Source
var SnapshotColumns = struct {
	ID                 string
	CreatedAt          string
	UpdatedAt          string
	ProviderSnapshotID string
	SnapRuleID         string
}{
	ID:                 "id",
	CreatedAt:          "created_at",
	UpdatedAt:          "updated_at",
	ProviderSnapshotID: "provider_snapshot_id",
	SnapRuleID:         "snap_rule_id",
}
View Source
var SnapshotRels = struct {
	SnapRule string
}{
	SnapRule: "SnapRule",
}

SnapshotRels is where relationship names are stored.

View Source
var SnapshotWhere = struct {
	ID                 whereHelperint
	CreatedAt          whereHelpernull_Time
	UpdatedAt          whereHelpernull_Time
	ProviderSnapshotID whereHelperstring
	SnapRuleID         whereHelperint
}{
	ID:                 whereHelperint{/* contains filtered or unexported fields */},
	CreatedAt:          whereHelpernull_Time{/* contains filtered or unexported fields */},
	UpdatedAt:          whereHelpernull_Time{/* contains filtered or unexported fields */},
	ProviderSnapshotID: whereHelperstring{/* contains filtered or unexported fields */},
	SnapRuleID:         whereHelperint{/* contains filtered or unexported fields */},
}
View Source
var TableNames = struct {
	Accounts  string
	SnapRules string
	Snapshots string
	Users     string
}{
	Accounts:  "accounts",
	SnapRules: "snap_rules",
	Snapshots: "snapshots",
	Users:     "users",
}
View Source
var UserColumns = struct {
	ID        string
	CreatedAt string
	UpdatedAt string
	Email     string
	Password  string
}{
	ID:        "id",
	CreatedAt: "created_at",
	UpdatedAt: "updated_at",
	Email:     "email",
	Password:  "password",
}
View Source
var UserRels = struct {
	Accounts string
}{
	Accounts: "Accounts",
}

UserRels is where relationship names are stored.

View Source
var UserWhere = struct {
	ID        whereHelperint
	CreatedAt whereHelpernull_Time
	UpdatedAt whereHelpernull_Time
	Email     whereHelperstring
	Password  whereHelperstring
}{
	ID:        whereHelperint{/* contains filtered or unexported fields */},
	CreatedAt: whereHelpernull_Time{/* contains filtered or unexported fields */},
	UpdatedAt: whereHelpernull_Time{/* contains filtered or unexported fields */},
	Email:     whereHelperstring{/* contains filtered or unexported fields */},
	Password:  whereHelperstring{/* contains filtered or unexported fields */},
}

Functions

func AccountExists

func AccountExists(exec boil.Executor, iD int) (bool, error)

AccountExists checks if the Account row exists.

func Accounts

func Accounts(mods ...qm.QueryMod) accountQuery

Accounts retrieves all the records using an executor.

func AddAccountHook

func AddAccountHook(hookPoint boil.HookPoint, accountHook AccountHook)

AddAccountHook registers your hook function for all future operations.

func AddSnapRuleHook

func AddSnapRuleHook(hookPoint boil.HookPoint, snapRuleHook SnapRuleHook)

AddSnapRuleHook registers your hook function for all future operations.

func AddSnapshotHook

func AddSnapshotHook(hookPoint boil.HookPoint, snapshotHook SnapshotHook)

AddSnapshotHook registers your hook function for all future operations.

func AddUserHook

func AddUserHook(hookPoint boil.HookPoint, userHook UserHook)

AddUserHook registers your hook function for all future operations.

func NewQuery

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

NewQuery initializes a new Query using the passed in QueryMods

func SnapRuleExists

func SnapRuleExists(exec boil.Executor, iD int) (bool, error)

SnapRuleExists checks if the SnapRule row exists.

func SnapRules

func SnapRules(mods ...qm.QueryMod) snapRuleQuery

SnapRules retrieves all the records using an executor.

func SnapshotExists

func SnapshotExists(exec boil.Executor, iD int) (bool, error)

SnapshotExists checks if the Snapshot row exists.

func Snapshots

func Snapshots(mods ...qm.QueryMod) snapshotQuery

Snapshots retrieves all the records using an executor.

func UserExists

func UserExists(exec boil.Executor, iD int) (bool, error)

UserExists checks if the User row exists.

func Users

func Users(mods ...qm.QueryMod) userQuery

Users retrieves all the records using an executor.

Types

type Account

type Account struct {
	ID        int       `boil:"id" json:"id" toml:"id" yaml:"id"`
	CreatedAt null.Time `boil:"created_at" json:"created_at,omitempty" toml:"created_at" yaml:"created_at,omitempty"`
	UpdatedAt null.Time `boil:"updated_at" json:"updated_at,omitempty" toml:"updated_at" yaml:"updated_at,omitempty"`
	Name      string    `boil:"name" json:"name" toml:"name" yaml:"name"`
	Provider  string    `boil:"provider" json:"provider" toml:"provider" yaml:"provider"`
	Token     string    `boil:"token" json:"token" toml:"token" yaml:"token"`
	UserID    int       `boil:"user_id" json:"user_id" toml:"user_id" yaml:"user_id"`

	R *accountR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L accountL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Account is an object representing the database table.

func FindAccount

func FindAccount(exec boil.Executor, iD int, selectCols ...string) (*Account, error)

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

func (*Account) AddSnapRules

func (o *Account) AddSnapRules(exec boil.Executor, insert bool, related ...*SnapRule) error

AddSnapRules adds the given related objects to the existing relationships of the account, optionally inserting them as new records. Appends related to o.R.SnapRules. Sets related.R.Account appropriately.

func (*Account) Delete

func (o *Account) Delete(exec boil.Executor) (int64, error)

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

func (*Account) Insert

func (o *Account) Insert(exec boil.Executor, columns boil.Columns) error

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

func (*Account) Reload

func (o *Account) Reload(exec boil.Executor) error

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

func (*Account) SetUser

func (o *Account) SetUser(exec boil.Executor, insert bool, related *User) error

SetUser of the account to the related item. Sets o.R.User to related. Adds o to related.R.Accounts.

func (*Account) SnapRules

func (o *Account) SnapRules(mods ...qm.QueryMod) snapRuleQuery

SnapRules retrieves all the snap_rule's SnapRules with an executor.

func (*Account) Update

func (o *Account) Update(exec boil.Executor, columns boil.Columns) (int64, error)

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

func (o *Account) Upsert(exec boil.Executor, 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.

func (*Account) User

func (o *Account) User(mods ...qm.QueryMod) userQuery

User pointed to by the foreign key.

type AccountHook

type AccountHook func(boil.Executor, *Account) error

AccountHook is the signature for custom Account hook methods

type AccountSlice

type AccountSlice []*Account

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

func (AccountSlice) DeleteAll

func (o AccountSlice) DeleteAll(exec boil.Executor) (int64, error)

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

func (*AccountSlice) ReloadAll

func (o *AccountSlice) ReloadAll(exec boil.Executor) error

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

func (AccountSlice) UpdateAll

func (o AccountSlice) UpdateAll(exec boil.Executor, 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 SnapRule

type SnapRule struct {
	ID                 int       `boil:"id" json:"id" toml:"id" yaml:"id"`
	CreatedAt          null.Time `boil:"created_at" json:"created_at,omitempty" toml:"created_at" yaml:"created_at,omitempty"`
	UpdatedAt          null.Time `boil:"updated_at" json:"updated_at,omitempty" toml:"updated_at" yaml:"updated_at,omitempty"`
	Frequency          int       `boil:"frequency" json:"frequency" toml:"frequency" yaml:"frequency"`
	VolumeID           string    `boil:"volume_id" json:"volume_id" toml:"volume_id" yaml:"volume_id"`
	VolumeName         string    `boil:"volume_name" json:"volume_name" toml:"volume_name" yaml:"volume_name"`
	VolumeRegion       string    `boil:"volume_region" json:"volume_region" toml:"volume_region" yaml:"volume_region"`
	AccountID          int       `boil:"account_id" json:"account_id" toml:"account_id" yaml:"account_id"`
	VolumeOrganization string    `boil:"volume_organization" json:"volume_organization" toml:"volume_organization" yaml:"volume_organization"`

	R *snapRuleR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L snapRuleL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

SnapRule is an object representing the database table.

func FindSnapRule

func FindSnapRule(exec boil.Executor, iD int, selectCols ...string) (*SnapRule, error)

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

func (*SnapRule) Account

func (o *SnapRule) Account(mods ...qm.QueryMod) accountQuery

Account pointed to by the foreign key.

func (*SnapRule) AddSnapshots

func (o *SnapRule) AddSnapshots(exec boil.Executor, insert bool, related ...*Snapshot) error

AddSnapshots adds the given related objects to the existing relationships of the snap_rule, optionally inserting them as new records. Appends related to o.R.Snapshots. Sets related.R.SnapRule appropriately.

func (*SnapRule) Delete

func (o *SnapRule) Delete(exec boil.Executor) (int64, error)

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

func (*SnapRule) Insert

func (o *SnapRule) Insert(exec boil.Executor, columns boil.Columns) error

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

func (*SnapRule) Reload

func (o *SnapRule) Reload(exec boil.Executor) error

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

func (*SnapRule) SetAccount

func (o *SnapRule) SetAccount(exec boil.Executor, insert bool, related *Account) error

SetAccount of the snapRule to the related item. Sets o.R.Account to related. Adds o to related.R.SnapRules.

func (*SnapRule) Snapshots

func (o *SnapRule) Snapshots(mods ...qm.QueryMod) snapshotQuery

Snapshots retrieves all the snapshot's Snapshots with an executor.

func (*SnapRule) Update

func (o *SnapRule) Update(exec boil.Executor, columns boil.Columns) (int64, error)

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

func (o *SnapRule) Upsert(exec boil.Executor, 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 SnapRuleHook

type SnapRuleHook func(boil.Executor, *SnapRule) error

SnapRuleHook is the signature for custom SnapRule hook methods

type SnapRuleSlice

type SnapRuleSlice []*SnapRule

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

func (SnapRuleSlice) DeleteAll

func (o SnapRuleSlice) DeleteAll(exec boil.Executor) (int64, error)

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

func (*SnapRuleSlice) ReloadAll

func (o *SnapRuleSlice) ReloadAll(exec boil.Executor) error

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

func (SnapRuleSlice) UpdateAll

func (o SnapRuleSlice) UpdateAll(exec boil.Executor, cols M) (int64, error)

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

type Snapshot

type Snapshot struct {
	ID                 int       `boil:"id" json:"id" toml:"id" yaml:"id"`
	CreatedAt          null.Time `boil:"created_at" json:"created_at,omitempty" toml:"created_at" yaml:"created_at,omitempty"`
	UpdatedAt          null.Time `boil:"updated_at" json:"updated_at,omitempty" toml:"updated_at" yaml:"updated_at,omitempty"`
	ProviderSnapshotID string    `boil:"provider_snapshot_id" json:"provider_snapshot_id" toml:"provider_snapshot_id" yaml:"provider_snapshot_id"`
	SnapRuleID         int       `boil:"snap_rule_id" json:"snap_rule_id" toml:"snap_rule_id" yaml:"snap_rule_id"`

	R *snapshotR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L snapshotL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Snapshot is an object representing the database table.

func FindSnapshot

func FindSnapshot(exec boil.Executor, iD int, selectCols ...string) (*Snapshot, error)

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

func (*Snapshot) Delete

func (o *Snapshot) Delete(exec boil.Executor) (int64, error)

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

func (*Snapshot) Insert

func (o *Snapshot) Insert(exec boil.Executor, columns boil.Columns) error

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

func (*Snapshot) Reload

func (o *Snapshot) Reload(exec boil.Executor) error

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

func (*Snapshot) SetSnapRule

func (o *Snapshot) SetSnapRule(exec boil.Executor, insert bool, related *SnapRule) error

SetSnapRule of the snapshot to the related item. Sets o.R.SnapRule to related. Adds o to related.R.Snapshots.

func (*Snapshot) SnapRule

func (o *Snapshot) SnapRule(mods ...qm.QueryMod) snapRuleQuery

SnapRule pointed to by the foreign key.

func (*Snapshot) Update

func (o *Snapshot) Update(exec boil.Executor, columns boil.Columns) (int64, error)

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

func (o *Snapshot) Upsert(exec boil.Executor, 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 SnapshotHook

type SnapshotHook func(boil.Executor, *Snapshot) error

SnapshotHook is the signature for custom Snapshot hook methods

type SnapshotSlice

type SnapshotSlice []*Snapshot

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

func (SnapshotSlice) DeleteAll

func (o SnapshotSlice) DeleteAll(exec boil.Executor) (int64, error)

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

func (*SnapshotSlice) ReloadAll

func (o *SnapshotSlice) ReloadAll(exec boil.Executor) error

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

func (SnapshotSlice) UpdateAll

func (o SnapshotSlice) UpdateAll(exec boil.Executor, cols M) (int64, error)

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

type User

type User struct {
	ID        int       `boil:"id" json:"id" toml:"id" yaml:"id"`
	CreatedAt null.Time `boil:"created_at" json:"created_at,omitempty" toml:"created_at" yaml:"created_at,omitempty"`
	UpdatedAt null.Time `boil:"updated_at" json:"updated_at,omitempty" toml:"updated_at" yaml:"updated_at,omitempty"`
	Email     string    `boil:"email" json:"email" toml:"email" yaml:"email"`
	Password  string    `boil:"password" json:"password" toml:"password" yaml:"password"`

	R *userR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L userL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

User is an object representing the database table.

func FindUser

func FindUser(exec boil.Executor, iD int, selectCols ...string) (*User, error)

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

func (*User) Accounts

func (o *User) Accounts(mods ...qm.QueryMod) accountQuery

Accounts retrieves all the account's Accounts with an executor.

func (*User) AddAccounts

func (o *User) AddAccounts(exec boil.Executor, insert bool, related ...*Account) error

AddAccounts adds the given related objects to the existing relationships of the user, optionally inserting them as new records. Appends related to o.R.Accounts. Sets related.R.User appropriately.

func (*User) Delete

func (o *User) Delete(exec boil.Executor) (int64, error)

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

func (*User) Insert

func (o *User) Insert(exec boil.Executor, columns boil.Columns) error

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

func (*User) Reload

func (o *User) Reload(exec boil.Executor) error

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

func (*User) Update

func (o *User) Update(exec boil.Executor, columns boil.Columns) (int64, error)

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

func (o *User) Upsert(exec boil.Executor, 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 UserHook

type UserHook func(boil.Executor, *User) error

UserHook is the signature for custom User hook methods

type UserSlice

type UserSlice []*User

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

func (UserSlice) DeleteAll

func (o UserSlice) DeleteAll(exec boil.Executor) (int64, error)

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

func (*UserSlice) ReloadAll

func (o *UserSlice) ReloadAll(exec boil.Executor) error

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

func (UserSlice) UpdateAll

func (o UserSlice) UpdateAll(exec boil.Executor, 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