models

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2021 License: MIT Imports: 15 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 ServiceColumns = struct {
	ID          string
	Name        string
	Description string
	ServicePath string
	TargetHost  string
	TargetPath  string
	TargetPort  string
	Methods     string
}{
	ID:          "id",
	Name:        "name",
	Description: "description",
	ServicePath: "service_path",
	TargetHost:  "target_host",
	TargetPath:  "target_path",
	TargetPort:  "target_port",
	Methods:     "methods",
}
View Source
var ServiceRels = struct {
}{}

ServiceRels is where relationship names are stored.

View Source
var ServiceWhere = struct {
	ID          whereHelperuint
	Name        whereHelperstring
	Description whereHelperstring
	ServicePath whereHelperstring
	TargetHost  whereHelperstring
	TargetPath  whereHelpernull_String
	TargetPort  whereHelpernull_Uint
	Methods     whereHelperstring
}{
	ID:          whereHelperuint{/* contains filtered or unexported fields */},
	Name:        whereHelperstring{/* contains filtered or unexported fields */},
	Description: whereHelperstring{/* contains filtered or unexported fields */},
	ServicePath: whereHelperstring{/* contains filtered or unexported fields */},
	TargetHost:  whereHelperstring{/* contains filtered or unexported fields */},
	TargetPath:  whereHelpernull_String{/* contains filtered or unexported fields */},
	TargetPort:  whereHelpernull_Uint{/* contains filtered or unexported fields */},
	Methods:     whereHelperstring{/* contains filtered or unexported fields */},
}
View Source
var TableNames = struct {
	Service string
	User    string
}{
	Service: "service",
	User:    "user",
}
View Source
var UserColumns = struct {
	ID        string
	Username  string
	Password  string
	Email     string
	CreatedAt string
	UpdatedAt string
}{
	ID:        "id",
	Username:  "username",
	Password:  "password",
	Email:     "email",
	CreatedAt: "created_at",
	UpdatedAt: "updated_at",
}
View Source
var UserRels = struct {
}{}

UserRels is where relationship names are stored.

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

Functions

func AddServiceHook

func AddServiceHook(hookPoint boil.HookPoint, serviceHook ServiceHook)

AddServiceHook 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 ServiceExists

func ServiceExists(exec boil.Executor, iD uint) (bool, error)

ServiceExists checks if the Service row exists.

func ServiceExistsG

func ServiceExistsG(iD uint) (bool, error)

ServiceExistsG checks if the Service row exists.

func Services

func Services(mods ...qm.QueryMod) serviceQuery

Services retrieves all the records using an executor.

func UserExists

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

UserExists checks if the User row exists.

func UserExistsG

func UserExistsG(iD uint) (bool, error)

UserExistsG checks if the User row exists.

func Users

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

Users retrieves all the records using an executor.

Types

type M

type M map[string]interface{}

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

type Service

type Service struct {
	ID          uint        `boil:"id" json:"id" toml:"id" yaml:"id"`
	Name        string      `boil:"name" json:"name" toml:"name" yaml:"name"`
	Description string      `boil:"description" json:"description" toml:"description" yaml:"description"`
	ServicePath string      `boil:"service_path" json:"service_path" toml:"service_path" yaml:"service_path"`
	TargetHost  string      `boil:"target_host" json:"target_host" toml:"target_host" yaml:"target_host"`
	TargetPath  null.String `boil:"target_path" json:"target_path,omitempty" toml:"target_path" yaml:"target_path,omitempty"`
	TargetPort  null.Uint   `boil:"target_port" json:"target_port,omitempty" toml:"target_port" yaml:"target_port,omitempty"`
	Methods     string      `boil:"methods" json:"methods" toml:"methods" yaml:"methods"`

	R *serviceR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L serviceL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Service is an object representing the database table.

func FindService

func FindService(exec boil.Executor, iD uint, selectCols ...string) (*Service, error)

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

func FindServiceG

func FindServiceG(iD uint, selectCols ...string) (*Service, error)

FindServiceG retrieves a single record by ID.

func (*Service) Delete

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

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

func (*Service) DeleteG

func (o *Service) DeleteG() (int64, error)

DeleteG deletes a single Service record. DeleteG will match against the primary key column to find the record to delete.

func (*Service) Insert

func (o *Service) 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 (*Service) InsertG

func (o *Service) InsertG(columns boil.Columns) error

InsertG a single record. See Insert for whitelist behavior description.

func (*Service) Reload

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

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

func (*Service) ReloadG

func (o *Service) ReloadG() error

ReloadG refetches the object from the database using the primary keys.

func (*Service) Update

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

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

func (o *Service) UpdateG(columns boil.Columns) (int64, error)

UpdateG a single Service record using the global executor. See Update for more documentation.

func (*Service) Upsert

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

func (o *Service) UpsertG(updateColumns, insertColumns boil.Columns) error

UpsertG attempts an insert, and does an update or ignore on conflict.

type ServiceHook

type ServiceHook func(boil.Executor, *Service) error

ServiceHook is the signature for custom Service hook methods

type ServiceSlice

type ServiceSlice []*Service

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

func (ServiceSlice) DeleteAll

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

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

func (ServiceSlice) DeleteAllG

func (o ServiceSlice) DeleteAllG() (int64, error)

DeleteAllG deletes all rows in the slice.

func (*ServiceSlice) ReloadAll

func (o *ServiceSlice) 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 (*ServiceSlice) ReloadAllG

func (o *ServiceSlice) ReloadAllG() error

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

func (ServiceSlice) UpdateAll

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

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

func (ServiceSlice) UpdateAllG

func (o ServiceSlice) UpdateAllG(cols M) (int64, error)

UpdateAllG updates all rows with the specified column values.

type User

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

	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 uint, selectCols ...string) (*User, error)

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

func FindUserG

func FindUserG(iD uint, selectCols ...string) (*User, error)

FindUserG retrieves a single record by ID.

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) DeleteG

func (o *User) DeleteG() (int64, error)

DeleteG deletes a single User record. DeleteG 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) InsertG

func (o *User) InsertG(columns boil.Columns) error

InsertG a single record. See Insert for whitelist behavior description.

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) ReloadG

func (o *User) ReloadG() error

ReloadG refetches the object from the database using the primary keys.

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) UpdateG

func (o *User) UpdateG(columns boil.Columns) (int64, error)

UpdateG a single User record using the global executor. See Update for more documentation.

func (*User) Upsert

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

func (o *User) UpsertG(updateColumns, insertColumns boil.Columns) error

UpsertG attempts an insert, and does an update or ignore on conflict.

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) DeleteAllG

func (o UserSlice) DeleteAllG() (int64, error)

DeleteAllG deletes all rows in the slice.

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) ReloadAllG

func (o *UserSlice) ReloadAllG() error

ReloadAllG 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.

func (UserSlice) UpdateAllG

func (o UserSlice) UpdateAllG(cols M) (int64, error)

UpdateAllG updates all rows with the specified column values.

Jump to

Keyboard shortcuts

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