Documentation ¶
Index ¶
- Constants
- Variables
- func AddUserHook(hookPoint boil.HookPoint, userHook UserHook)
- func AddUserProviderHook(hookPoint boil.HookPoint, userProviderHook UserProviderHook)
- func NewQuery(mods ...qm.QueryMod) *queries.Query
- func UserExists(exec boil.Executor, iD string) (bool, error)
- func UserExistsG(iD string) (bool, error)
- func UserProviderExists(exec boil.Executor, provider string, providerID string) (bool, error)
- func UserProviderExistsG(provider string, providerID string) (bool, error)
- func UserProviders(mods ...qm.QueryMod) userProviderQuery
- func Users(mods ...qm.QueryMod) userQuery
- type M
- type User
- func (o *User) AddUserProviders(exec boil.Executor, insert bool, related ...*UserProvider) error
- func (o *User) AddUserProvidersG(insert bool, related ...*UserProvider) error
- func (o *User) Delete(exec boil.Executor) (int64, error)
- func (o *User) DeleteG() (int64, error)
- func (o *User) Insert(exec boil.Executor, columns boil.Columns) error
- func (o *User) InsertG(columns boil.Columns) error
- func (o *User) Reload(exec boil.Executor) error
- func (o *User) ReloadG() error
- func (o *User) Update(exec boil.Executor, columns boil.Columns) (int64, error)
- func (o *User) UpdateG(columns boil.Columns) (int64, error)
- func (o *User) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, ...) error
- func (o *User) UpsertG(updateOnConflict bool, conflictColumns []string, ...) error
- func (o *User) UserProviders(mods ...qm.QueryMod) userProviderQuery
- type UserHook
- type UserProvider
- func (o *UserProvider) Delete(exec boil.Executor) (int64, error)
- func (o *UserProvider) DeleteG() (int64, error)
- func (o *UserProvider) Insert(exec boil.Executor, columns boil.Columns) error
- func (o *UserProvider) InsertG(columns boil.Columns) error
- func (o *UserProvider) Reload(exec boil.Executor) error
- func (o *UserProvider) ReloadG() error
- func (o *UserProvider) SetUser(exec boil.Executor, insert bool, related *User) error
- func (o *UserProvider) SetUserG(insert bool, related *User) error
- func (o *UserProvider) Update(exec boil.Executor, columns boil.Columns) (int64, error)
- func (o *UserProvider) UpdateG(columns boil.Columns) (int64, error)
- func (o *UserProvider) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, ...) error
- func (o *UserProvider) UpsertG(updateOnConflict bool, conflictColumns []string, ...) error
- func (o *UserProvider) User(mods ...qm.QueryMod) userQuery
- type UserProviderHook
- type UserProviderSlice
- func (o UserProviderSlice) DeleteAll(exec boil.Executor) (int64, error)
- func (o UserProviderSlice) DeleteAllG() (int64, error)
- func (o *UserProviderSlice) ReloadAll(exec boil.Executor) error
- func (o *UserProviderSlice) ReloadAllG() error
- func (o UserProviderSlice) UpdateAll(exec boil.Executor, cols M) (int64, error)
- func (o UserProviderSlice) UpdateAllG(cols M) (int64, error)
- type UserSlice
- func (o UserSlice) DeleteAll(exec boil.Executor) (int64, error)
- func (o UserSlice) DeleteAllG() (int64, error)
- func (o *UserSlice) ReloadAll(exec boil.Executor) error
- func (o *UserSlice) ReloadAllG() error
- func (o UserSlice) UpdateAll(exec boil.Executor, cols M) (int64, error)
- func (o UserSlice) UpdateAllG(cols M) (int64, error)
Constants ¶
const ( UserRoleAdmin = "admin" UserRoleStaff = "staff" UserRoleUser = "user" )
Enum values for user_role
const ( UserStateEnable = "enable" UserStateDisable = "disable" UserStateMaintenance = "maintenance" )
Enum values for user_state
Variables ¶
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.
var TableNames = struct { UserProviders string Users string }{ UserProviders: "user_providers", Users: "users", }
var UserColumns = struct { ID string Email string EmailHash string Username string Password string DisplayName string Picture string TokenVersion string Role string State string CreatedAt string UpdatedAt string }{ ID: "id", Email: "email", EmailHash: "email_hash", Username: "username", Password: "password", DisplayName: "display_name", Picture: "picture", TokenVersion: "token_version", Role: "role", State: "state", CreatedAt: "created_at", UpdatedAt: "updated_at", }
var UserProviderColumns = struct { UserID string Provider string ProviderID string CreatedAt string UpdatedAt string }{ UserID: "user_id", Provider: "provider", ProviderID: "provider_id", CreatedAt: "created_at", UpdatedAt: "updated_at", }
var UserProviderRels = struct { User string }{ User: "User", }
UserProviderRels is where relationship names are stored.
var UserProviderWhere = struct { UserID whereHelperstring Provider whereHelperstring ProviderID whereHelperstring CreatedAt whereHelpertime_Time UpdatedAt whereHelpernull_Time }{ UserID: whereHelperstring{/* contains filtered or unexported fields */}, Provider: whereHelperstring{/* contains filtered or unexported fields */}, ProviderID: whereHelperstring{/* contains filtered or unexported fields */}, CreatedAt: whereHelpertime_Time{/* contains filtered or unexported fields */}, UpdatedAt: whereHelpernull_Time{/* contains filtered or unexported fields */}, }
var UserRels = struct { UserProviders string }{ UserProviders: "UserProviders", }
UserRels is where relationship names are stored.
var UserWhere = struct { ID whereHelperstring Email whereHelperstring EmailHash whereHelperstring Username whereHelpernull_String Password whereHelpernull_String DisplayName whereHelpernull_String Picture whereHelpernull_String TokenVersion whereHelpernull_Int64 Role whereHelperstring State whereHelperstring CreatedAt whereHelpertime_Time UpdatedAt whereHelpernull_Time }{ ID: whereHelperstring{/* contains filtered or unexported fields */}, Email: whereHelperstring{/* contains filtered or unexported fields */}, EmailHash: whereHelperstring{/* contains filtered or unexported fields */}, Username: whereHelpernull_String{/* contains filtered or unexported fields */}, Password: whereHelpernull_String{/* contains filtered or unexported fields */}, DisplayName: whereHelpernull_String{/* contains filtered or unexported fields */}, Picture: whereHelpernull_String{/* contains filtered or unexported fields */}, TokenVersion: whereHelpernull_Int64{/* contains filtered or unexported fields */}, Role: whereHelperstring{/* contains filtered or unexported fields */}, State: whereHelperstring{/* contains filtered or unexported fields */}, CreatedAt: whereHelpertime_Time{/* contains filtered or unexported fields */}, UpdatedAt: whereHelpernull_Time{/* contains filtered or unexported fields */}, }
Functions ¶
func AddUserHook ¶
AddUserHook registers your hook function for all future operations.
func AddUserProviderHook ¶
func AddUserProviderHook(hookPoint boil.HookPoint, userProviderHook UserProviderHook)
AddUserProviderHook registers your hook function for all future operations.
func UserExists ¶
UserExists checks if the User row exists.
func UserExistsG ¶
UserExistsG checks if the User row exists.
func UserProviderExists ¶
UserProviderExists checks if the UserProvider row exists.
func UserProviderExistsG ¶
UserProviderExistsG checks if the UserProvider row exists.
func UserProviders ¶
UserProviders 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 User ¶
type User struct { ID string `boil:"id" json:"id" toml:"id" yaml:"id"` Email string `boil:"email" json:"email" toml:"email" yaml:"email"` EmailHash string `boil:"email_hash" json:"email_hash" toml:"email_hash" yaml:"email_hash"` Username null.String `boil:"username" json:"username,omitempty" toml:"username" yaml:"username,omitempty"` Password null.String `boil:"password" json:"password,omitempty" toml:"password" yaml:"password,omitempty"` DisplayName null.String `boil:"display_name" json:"display_name,omitempty" toml:"display_name" yaml:"display_name,omitempty"` Picture null.String `boil:"picture" json:"picture,omitempty" toml:"picture" yaml:"picture,omitempty"` TokenVersion null.Int64 `boil:"token_version" json:"token_version,omitempty" toml:"token_version" yaml:"token_version,omitempty"` Role string `boil:"role" json:"role" toml:"role" yaml:"role"` State string `boil:"state" json:"state" toml:"state" yaml:"state"` 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 ¶
FindUser retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.
func (*User) AddUserProviders ¶
AddUserProviders adds the given related objects to the existing relationships of the user, optionally inserting them as new records. Appends related to o.R.UserProviders. Sets related.R.User appropriately.
func (*User) AddUserProvidersG ¶
func (o *User) AddUserProvidersG(insert bool, related ...*UserProvider) error
AddUserProvidersG adds the given related objects to the existing relationships of the user, optionally inserting them as new records. Appends related to o.R.UserProviders. Sets related.R.User appropriately. Uses the global database handle.
func (*User) Delete ¶
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 ¶
DeleteG deletes a single User record. DeleteG will match against the primary key column to find the record to delete.
func (*User) Insert ¶
Insert a single record using an executor. See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts.
func (*User) Reload ¶
Reload refetches the object from the database using the primary keys with an executor.
func (*User) Update ¶
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 ¶
UpdateG a single User record using the global executor. See Update for more documentation.
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.
func (*User) UpsertG ¶
func (o *User) UpsertG(updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns) error
UpsertG attempts an insert, and does an update or ignore on conflict.
func (*User) UserProviders ¶
UserProviders retrieves all the user_provider's UserProviders with an executor.
type UserProvider ¶
type UserProvider struct { UserID string `boil:"user_id" json:"user_id" toml:"user_id" yaml:"user_id"` Provider string `boil:"provider" json:"provider" toml:"provider" yaml:"provider"` ProviderID string `boil:"provider_id" json:"provider_id" toml:"provider_id" yaml:"provider_id"` 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 *userProviderR `boil:"-" json:"-" toml:"-" yaml:"-"` L userProviderL `boil:"-" json:"-" toml:"-" yaml:"-"` }
UserProvider is an object representing the database table.
func FindUserProvider ¶
func FindUserProvider(exec boil.Executor, provider string, providerID string, selectCols ...string) (*UserProvider, error)
FindUserProvider retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.
func FindUserProviderG ¶
func FindUserProviderG(provider string, providerID string, selectCols ...string) (*UserProvider, error)
FindUserProviderG retrieves a single record by ID.
func (*UserProvider) Delete ¶
func (o *UserProvider) Delete(exec boil.Executor) (int64, error)
Delete deletes a single UserProvider record with an executor. Delete will match against the primary key column to find the record to delete.
func (*UserProvider) DeleteG ¶
func (o *UserProvider) DeleteG() (int64, error)
DeleteG deletes a single UserProvider record. DeleteG will match against the primary key column to find the record to delete.
func (*UserProvider) Insert ¶
Insert a single record using an executor. See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts.
func (*UserProvider) InsertG ¶
func (o *UserProvider) InsertG(columns boil.Columns) error
InsertG a single record. See Insert for whitelist behavior description.
func (*UserProvider) Reload ¶
func (o *UserProvider) Reload(exec boil.Executor) error
Reload refetches the object from the database using the primary keys with an executor.
func (*UserProvider) ReloadG ¶
func (o *UserProvider) ReloadG() error
ReloadG refetches the object from the database using the primary keys.
func (*UserProvider) SetUser ¶
SetUser of the userProvider to the related item. Sets o.R.User to related. Adds o to related.R.UserProviders.
func (*UserProvider) SetUserG ¶
func (o *UserProvider) SetUserG(insert bool, related *User) error
SetUserG of the userProvider to the related item. Sets o.R.User to related. Adds o to related.R.UserProviders. Uses the global database handle.
func (*UserProvider) Update ¶
Update uses an executor to update the UserProvider. 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 (*UserProvider) UpdateG ¶
func (o *UserProvider) UpdateG(columns boil.Columns) (int64, error)
UpdateG a single UserProvider record using the global executor. See Update for more documentation.
func (*UserProvider) Upsert ¶
func (o *UserProvider) 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 (*UserProvider) UpsertG ¶
func (o *UserProvider) UpsertG(updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns) error
UpsertG attempts an insert, and does an update or ignore on conflict.
func (*UserProvider) User ¶
func (o *UserProvider) User(mods ...qm.QueryMod) userQuery
User pointed to by the foreign key.
type UserProviderHook ¶
type UserProviderHook func(boil.Executor, *UserProvider) error
UserProviderHook is the signature for custom UserProvider hook methods
type UserProviderSlice ¶
type UserProviderSlice []*UserProvider
UserProviderSlice is an alias for a slice of pointers to UserProvider. This should generally be used opposed to []UserProvider.
func (UserProviderSlice) DeleteAll ¶
func (o UserProviderSlice) DeleteAll(exec boil.Executor) (int64, error)
DeleteAll deletes all rows in the slice, using an executor.
func (UserProviderSlice) DeleteAllG ¶
func (o UserProviderSlice) DeleteAllG() (int64, error)
DeleteAllG deletes all rows in the slice.
func (*UserProviderSlice) ReloadAll ¶
func (o *UserProviderSlice) 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 (*UserProviderSlice) ReloadAllG ¶
func (o *UserProviderSlice) ReloadAllG() error
ReloadAllG refetches every row with matching primary key column values and overwrites the original object slice with the newly updated slice.
func (UserProviderSlice) UpdateAll ¶
UpdateAll updates all rows with the specified column values, using an executor.
func (UserProviderSlice) UpdateAllG ¶
func (o UserProviderSlice) UpdateAllG(cols M) (int64, error)
UpdateAllG updates all rows with the specified column values.
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) DeleteAllG ¶
DeleteAllG deletes all rows in the slice.
func (*UserSlice) ReloadAll ¶
ReloadAll refetches every row with matching primary key column values and overwrites the original object slice with the newly updated slice.
func (*UserSlice) ReloadAllG ¶
ReloadAllG refetches every row with matching primary key column values and overwrites the original object slice with the newly updated slice.