Documentation ¶
Index ¶
- Constants
- Variables
- func AddAuthTokenHook(hookPoint boil.HookPoint, authTokenHook AuthTokenHook)
- func AddUserHook(hookPoint boil.HookPoint, userHook UserHook)
- func AuthTokenExists(ctx context.Context, exec boil.ContextExecutor, iD int64) (bool, error)
- func AuthTokens(mods ...qm.QueryMod) authTokenQuery
- func NewQuery(mods ...qm.QueryMod) *queries.Query
- func UserExists(ctx context.Context, exec boil.ContextExecutor, iD int64) (bool, error)
- func Users(mods ...qm.QueryMod) userQuery
- type AuthToken
- func (o *AuthToken) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)
- func (o *AuthToken) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error
- func (o *AuthToken) Reload(ctx context.Context, exec boil.ContextExecutor) error
- func (o *AuthToken) SetUser(ctx context.Context, exec boil.ContextExecutor, insert bool, related *User) error
- func (o *AuthToken) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
- func (o *AuthToken) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, ...) error
- func (o *AuthToken) User(mods ...qm.QueryMod) userQuery
- type AuthTokenHook
- type AuthTokenSlice
- type M
- type User
- func (o *User) AddAuthTokens(ctx context.Context, exec boil.ContextExecutor, insert bool, ...) error
- func (o *User) AuthTokens(mods ...qm.QueryMod) authTokenQuery
- func (o *User) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)
- func (o *User) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error
- func (o *User) Reload(ctx context.Context, exec boil.ContextExecutor) error
- func (o *User) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
- func (o *User) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, ...) error
- type UserHook
- type UserSlice
Constants ¶
const ( UserStatusNew = "new" UserStatusActive = "active" UserStatusBlocked = "blocked" )
Enum values for user_status
const ( UserRoleOwner = "owner" UserRoleRoot = "root" UserRoleUser = "user" )
Enum values for user_role
const (
TokenTypeAuth = "auth"
)
Enum values for token_type
Variables ¶
var AuthTokenColumns = struct { ID string UserID string Token string Type string DTExpired string DTCreated string }{ ID: "id", UserID: "user_id", Token: "token", Type: "type", DTExpired: "dt_expired", DTCreated: "dt_created", }
var AuthTokenRels = struct { User string }{ User: "User", }
AuthTokenRels is where relationship names are stored.
var AuthTokenWhere = struct { ID whereHelperint64 UserID whereHelperint64 Token whereHelperstring Type whereHelperstring DTExpired whereHelpertime_Time DTCreated whereHelpertime_Time }{ ID: whereHelperint64{/* contains filtered or unexported fields */}, UserID: whereHelperint64{/* contains filtered or unexported fields */}, Token: whereHelperstring{/* contains filtered or unexported fields */}, Type: whereHelperstring{/* contains filtered or unexported fields */}, DTExpired: whereHelpertime_Time{/* contains filtered or unexported fields */}, DTCreated: whereHelpertime_Time{/* contains filtered or unexported fields */}, }
var ErrSyncFail = errors.New("postgres: 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 { AuthToken string User string }{ AuthToken: "auth_token", User: "user", }
var UserColumns = struct { ID string Login string Password string Status string Name string Role string DTCreated string DTUpdated string DTLastLogged string }{ ID: "id", Login: "login", Password: "password", Status: "status", Name: "name", Role: "role", DTCreated: "dt_created", DTUpdated: "dt_updated", DTLastLogged: "dt_last_logged", }
var UserRels = struct { AuthTokens string }{ AuthTokens: "AuthTokens", }
UserRels is where relationship names are stored.
var UserWhere = struct { ID whereHelperint64 Login whereHelperstring Password whereHelperstring Status whereHelperstring Name whereHelperstring Role whereHelperstring DTCreated whereHelpertime_Time DTUpdated whereHelpertime_Time DTLastLogged whereHelpertime_Time }{ ID: whereHelperint64{/* contains filtered or unexported fields */}, Login: whereHelperstring{/* contains filtered or unexported fields */}, Password: whereHelperstring{/* contains filtered or unexported fields */}, Status: whereHelperstring{/* contains filtered or unexported fields */}, Name: whereHelperstring{/* contains filtered or unexported fields */}, Role: whereHelperstring{/* contains filtered or unexported fields */}, DTCreated: whereHelpertime_Time{/* contains filtered or unexported fields */}, DTUpdated: whereHelpertime_Time{/* contains filtered or unexported fields */}, DTLastLogged: whereHelpertime_Time{/* contains filtered or unexported fields */}, }
Functions ¶
func AddAuthTokenHook ¶
func AddAuthTokenHook(hookPoint boil.HookPoint, authTokenHook AuthTokenHook)
AddAuthTokenHook registers your hook function for all future operations.
func AddUserHook ¶
AddUserHook registers your hook function for all future operations.
func AuthTokenExists ¶
AuthTokenExists checks if the AuthToken row exists.
func AuthTokens ¶
AuthTokens retrieves all the records using an executor.
func UserExists ¶
UserExists checks if the User row exists.
Types ¶
type AuthToken ¶
type AuthToken struct { ID int64 `boil:"id" json:"id" toml:"id" yaml:"id"` UserID int64 `boil:"user_id" json:"user_id" toml:"user_id" yaml:"user_id"` Token string `boil:"token" json:"token" toml:"token" yaml:"token"` Type string `boil:"type" json:"type" toml:"type" yaml:"type"` DTExpired time.Time `boil:"dt_expired" json:"dt_expired" toml:"dt_expired" yaml:"dt_expired"` DTCreated time.Time `boil:"dt_created" json:"dt_created" toml:"dt_created" yaml:"dt_created"` R *authTokenR `boil:"-" json:"-" toml:"-" yaml:"-"` L authTokenL `boil:"-" json:"-" toml:"-" yaml:"-"` }
AuthToken is an object representing the database table.
func FindAuthToken ¶
func FindAuthToken(ctx context.Context, exec boil.ContextExecutor, iD int64, selectCols ...string) (*AuthToken, error)
FindAuthToken retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.
func (*AuthToken) Delete ¶
Delete deletes a single AuthToken record with an executor. Delete will match against the primary key column to find the record to delete.
func (*AuthToken) Insert ¶
func (o *AuthToken) 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 (*AuthToken) Reload ¶
Reload refetches the object from the database using the primary keys with an executor.
func (*AuthToken) SetUser ¶
func (o *AuthToken) SetUser(ctx context.Context, exec boil.ContextExecutor, insert bool, related *User) error
SetUser of the authToken to the related item. Sets o.R.User to related. Adds o to related.R.AuthTokens.
func (*AuthToken) Update ¶
func (o *AuthToken) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
Update uses an executor to update the AuthToken. 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 (*AuthToken) Upsert ¶
func (o *AuthToken) 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 AuthTokenHook ¶
AuthTokenHook is the signature for custom AuthToken hook methods
type AuthTokenSlice ¶
type AuthTokenSlice []*AuthToken
AuthTokenSlice is an alias for a slice of pointers to AuthToken. This should generally be used opposed to []AuthToken.
func (AuthTokenSlice) DeleteAll ¶
func (o AuthTokenSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error)
DeleteAll deletes all rows in the slice, using an executor.
func (*AuthTokenSlice) ReloadAll ¶
func (o *AuthTokenSlice) 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 (AuthTokenSlice) UpdateAll ¶
func (o AuthTokenSlice) 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 User ¶
type User struct { ID int64 `boil:"id" json:"id" toml:"id" yaml:"id"` Login string `boil:"login" json:"login" toml:"login" yaml:"login"` Password string `boil:"password" json:"password" toml:"password" yaml:"password"` Status string `boil:"status" json:"status" toml:"status" yaml:"status"` Name string `boil:"name" json:"name" toml:"name" yaml:"name"` Role string `boil:"role" json:"role" toml:"role" yaml:"role"` DTCreated time.Time `boil:"dt_created" json:"dt_created" toml:"dt_created" yaml:"dt_created"` DTUpdated time.Time `boil:"dt_updated" json:"dt_updated" toml:"dt_updated" yaml:"dt_updated"` DTLastLogged time.Time `boil:"dt_last_logged" json:"dt_last_logged" toml:"dt_last_logged" yaml:"dt_last_logged"` R *userR `boil:"-" json:"-" toml:"-" yaml:"-"` L userL `boil:"-" json:"-" toml:"-" yaml:"-"` }
User is an object representing the database table.
func FindUser ¶
func FindUser(ctx context.Context, exec boil.ContextExecutor, iD int64, 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) AddAuthTokens ¶
func (o *User) AddAuthTokens(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*AuthToken) error
AddAuthTokens adds the given related objects to the existing relationships of the user, optionally inserting them as new records. Appends related to o.R.AuthTokens. Sets related.R.User appropriately.
func (*User) AuthTokens ¶
AuthTokens retrieves all the auth_token's AuthTokens with an executor.
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) 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 ¶
func (o *User) Update(ctx context.Context, exec boil.ContextExecutor, 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(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 UserSlice ¶
type UserSlice []*User
UserSlice is an alias for a slice of pointers to User. This should generally be used opposed to []User.