models

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2020 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AudienceColumns = struct {
	ID          string
	CreatedAt   string
	UpdatedAt   string
	Name        string
	Description string
}{
	ID:          "id",
	CreatedAt:   "created_at",
	UpdatedAt:   "updated_at",
	Name:        "name",
	Description: "description",
}
View Source
var AudienceRels = struct {
	Users string
}{
	Users: "Users",
}

AudienceRels is where relationship names are stored.

View Source
var AudienceWhere = struct {
	ID          whereHelperint
	CreatedAt   whereHelpertime_Time
	UpdatedAt   whereHelpertime_Time
	Name        whereHelperstring
	Description whereHelperstring
}{
	ID:          whereHelperint{/* contains filtered or unexported fields */},
	CreatedAt:   whereHelpertime_Time{/* contains filtered or unexported fields */},
	UpdatedAt:   whereHelpertime_Time{/* contains filtered or unexported fields */},
	Name:        whereHelperstring{/* contains filtered or unexported fields */},
	Description: whereHelperstring{/* 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 GroupColumns = struct {
	ID          string
	CreatedAt   string
	UpdatedAt   string
	Name        string
	Description string
}{
	ID:          "id",
	CreatedAt:   "created_at",
	UpdatedAt:   "updated_at",
	Name:        "name",
	Description: "description",
}
View Source
var GroupRels = struct {
	Users string
}{
	Users: "Users",
}

GroupRels is where relationship names are stored.

View Source
var GroupWhere = struct {
	ID          whereHelperint
	CreatedAt   whereHelpertime_Time
	UpdatedAt   whereHelpertime_Time
	Name        whereHelperstring
	Description whereHelperstring
}{
	ID:          whereHelperint{/* contains filtered or unexported fields */},
	CreatedAt:   whereHelpertime_Time{/* contains filtered or unexported fields */},
	UpdatedAt:   whereHelpertime_Time{/* contains filtered or unexported fields */},
	Name:        whereHelperstring{/* contains filtered or unexported fields */},
	Description: whereHelperstring{/* contains filtered or unexported fields */},
}
View Source
var JWTKeyColumns = struct {
	ID        string
	PublicKey string
	CreatedAt string
}{
	ID:        "id",
	PublicKey: "public_key",
	CreatedAt: "created_at",
}
View Source
var JWTKeyRels = struct {
}{}

JWTKeyRels is where relationship names are stored.

View Source
var JWTKeyWhere = struct {
	ID        whereHelperint
	PublicKey whereHelper__byte
	CreatedAt whereHelpertime_Time
}{
	ID:        whereHelperint{/* contains filtered or unexported fields */},
	PublicKey: whereHelper__byte{/* contains filtered or unexported fields */},
	CreatedAt: whereHelpertime_Time{/* contains filtered or unexported fields */},
}
View Source
var PasswordColumns = struct {
	ID        string
	UserID    string
	CreatedAt string
	UpdatedAt string
	Salt      string
	Hash      string
}{
	ID:        "id",
	UserID:    "user_id",
	CreatedAt: "created_at",
	UpdatedAt: "updated_at",
	Salt:      "salt",
	Hash:      "hash",
}
View Source
var PasswordRels = struct {
	User string
}{
	User: "User",
}

PasswordRels is where relationship names are stored.

View Source
var PasswordWhere = struct {
	ID        whereHelperint
	UserID    whereHelperint
	CreatedAt whereHelpertime_Time
	UpdatedAt whereHelpertime_Time
	Salt      whereHelper__byte
	Hash      whereHelper__byte
}{
	ID:        whereHelperint{/* contains filtered or unexported fields */},
	UserID:    whereHelperint{/* contains filtered or unexported fields */},
	CreatedAt: whereHelpertime_Time{/* contains filtered or unexported fields */},
	UpdatedAt: whereHelpertime_Time{/* contains filtered or unexported fields */},
	Salt:      whereHelper__byte{/* contains filtered or unexported fields */},
	Hash:      whereHelper__byte{/* contains filtered or unexported fields */},
}
View Source
var TableNames = struct {
	Audiences     string
	Groups        string
	JWTKeys       string
	Passwords     string
	UserAudiences string
	UserGroups    string
	Users         string
}{
	Audiences:     "audiences",
	Groups:        "groups",
	JWTKeys:       "jwt_keys",
	Passwords:     "passwords",
	UserAudiences: "user_audiences",
	UserGroups:    "user_groups",
	Users:         "users",
}
View Source
var UserColumns = struct {
	ID        string
	Email     string
	Name      string
	CreatedAt string
	UpdatedAt string
}{
	ID:        "id",
	Email:     "email",
	Name:      "name",
	CreatedAt: "created_at",
	UpdatedAt: "updated_at",
}
View Source
var UserRels = struct {
	Password  string
	Audiences string
	Groups    string
}{
	Password:  "Password",
	Audiences: "Audiences",
	Groups:    "Groups",
}

UserRels is where relationship names are stored.

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

Functions

func AddAudienceHook

func AddAudienceHook(hookPoint boil.HookPoint, audienceHook AudienceHook)

AddAudienceHook registers your hook function for all future operations.

func AddGroupHook

func AddGroupHook(hookPoint boil.HookPoint, groupHook GroupHook)

AddGroupHook registers your hook function for all future operations.

func AddJWTKeyHook

func AddJWTKeyHook(hookPoint boil.HookPoint, jwtKeyHook JWTKeyHook)

AddJWTKeyHook registers your hook function for all future operations.

func AddPasswordHook

func AddPasswordHook(hookPoint boil.HookPoint, passwordHook PasswordHook)

AddPasswordHook 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 AudienceExists

func AudienceExists(ctx context.Context, exec boil.ContextExecutor, iD int) (bool, error)

AudienceExists checks if the Audience row exists.

func Audiences

func Audiences(mods ...qm.QueryMod) audienceQuery

Audiences retrieves all the records using an executor.

func GroupExists

func GroupExists(ctx context.Context, exec boil.ContextExecutor, iD int) (bool, error)

GroupExists checks if the Group row exists.

func Groups

func Groups(mods ...qm.QueryMod) groupQuery

Groups retrieves all the records using an executor.

func JWTKeyExists

func JWTKeyExists(ctx context.Context, exec boil.ContextExecutor, iD int) (bool, error)

JWTKeyExists checks if the JWTKey row exists.

func JWTKeys

func JWTKeys(mods ...qm.QueryMod) jwtKeyQuery

JWTKeys 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 PasswordExists

func PasswordExists(ctx context.Context, exec boil.ContextExecutor, iD int) (bool, error)

PasswordExists checks if the Password row exists.

func Passwords

func Passwords(mods ...qm.QueryMod) passwordQuery

Passwords retrieves all the records using an executor.

func UserExists

func UserExists(ctx context.Context, exec boil.ContextExecutor, 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 Audience

type Audience struct {
	ID          int       `boil:"id" json:"id" toml:"id" yaml:"id"`
	CreatedAt   time.Time `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"`
	UpdatedAt   time.Time `boil:"updated_at" json:"updated_at" toml:"updated_at" yaml:"updated_at"`
	Name        string    `boil:"name" json:"name" toml:"name" yaml:"name"`
	Description string    `boil:"description" json:"description" toml:"description" yaml:"description"`

	R *audienceR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L audienceL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Audience is an object representing the database table.

func FindAudience

func FindAudience(ctx context.Context, exec boil.ContextExecutor, iD int, selectCols ...string) (*Audience, error)

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

func (*Audience) AddUsers

func (o *Audience) AddUsers(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*User) error

AddUsers adds the given related objects to the existing relationships of the audience, optionally inserting them as new records. Appends related to o.R.Users. Sets related.R.Audiences appropriately.

func (*Audience) Delete

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

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

func (*Audience) Insert

func (o *Audience) 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 (*Audience) Reload

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

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

func (*Audience) RemoveUsers

func (o *Audience) RemoveUsers(ctx context.Context, exec boil.ContextExecutor, related ...*User) error

RemoveUsers relationships from objects passed in. Removes related items from R.Users (uses pointer comparison, removal does not keep order) Sets related.R.Audiences.

func (*Audience) SetUsers

func (o *Audience) SetUsers(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*User) error

SetUsers removes all previously related items of the audience replacing them completely with the passed in related items, optionally inserting them as new records. Sets o.R.Audiences's Users accordingly. Replaces o.R.Users with related. Sets related.R.Audiences's Users accordingly.

func (*Audience) Update

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

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

func (o *Audience) 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.

func (*Audience) Users

func (o *Audience) Users(mods ...qm.QueryMod) userQuery

Users retrieves all the user's Users with an executor.

type AudienceHook

type AudienceHook func(context.Context, boil.ContextExecutor, *Audience) error

AudienceHook is the signature for custom Audience hook methods

type AudienceSlice

type AudienceSlice []*Audience

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

func (AudienceSlice) DeleteAll

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

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

func (*AudienceSlice) ReloadAll

func (o *AudienceSlice) 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 (AudienceSlice) UpdateAll

func (o AudienceSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error)

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

type Group

type Group struct {
	ID          int       `boil:"id" json:"id" toml:"id" yaml:"id"`
	CreatedAt   time.Time `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"`
	UpdatedAt   time.Time `boil:"updated_at" json:"updated_at" toml:"updated_at" yaml:"updated_at"`
	Name        string    `boil:"name" json:"name" toml:"name" yaml:"name"`
	Description string    `boil:"description" json:"description" toml:"description" yaml:"description"`

	R *groupR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L groupL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Group is an object representing the database table.

func FindGroup

func FindGroup(ctx context.Context, exec boil.ContextExecutor, iD int, selectCols ...string) (*Group, error)

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

func (*Group) AddUsers

func (o *Group) AddUsers(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*User) error

AddUsers adds the given related objects to the existing relationships of the group, optionally inserting them as new records. Appends related to o.R.Users. Sets related.R.Groups appropriately.

func (*Group) Delete

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

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

func (*Group) Insert

func (o *Group) 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 (*Group) Reload

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

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

func (*Group) RemoveUsers

func (o *Group) RemoveUsers(ctx context.Context, exec boil.ContextExecutor, related ...*User) error

RemoveUsers relationships from objects passed in. Removes related items from R.Users (uses pointer comparison, removal does not keep order) Sets related.R.Groups.

func (*Group) SetUsers

func (o *Group) SetUsers(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*User) error

SetUsers removes all previously related items of the group replacing them completely with the passed in related items, optionally inserting them as new records. Sets o.R.Groups's Users accordingly. Replaces o.R.Users with related. Sets related.R.Groups's Users accordingly.

func (*Group) Update

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

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

func (o *Group) 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.

func (*Group) Users

func (o *Group) Users(mods ...qm.QueryMod) userQuery

Users retrieves all the user's Users with an executor.

type GroupHook

type GroupHook func(context.Context, boil.ContextExecutor, *Group) error

GroupHook is the signature for custom Group hook methods

type GroupSlice

type GroupSlice []*Group

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

func (GroupSlice) DeleteAll

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

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

func (*GroupSlice) ReloadAll

func (o *GroupSlice) 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 (GroupSlice) UpdateAll

func (o GroupSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error)

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

type JWTKey

type JWTKey struct {
	ID        int       `boil:"id" json:"id" toml:"id" yaml:"id"`
	PublicKey []byte    `boil:"public_key" json:"public_key" toml:"public_key" yaml:"public_key"`
	CreatedAt time.Time `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"`

	R *jwtKeyR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L jwtKeyL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

JWTKey is an object representing the database table.

func FindJWTKey

func FindJWTKey(ctx context.Context, exec boil.ContextExecutor, iD int, selectCols ...string) (*JWTKey, error)

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

func (*JWTKey) Delete

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

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

func (*JWTKey) Insert

func (o *JWTKey) 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 (*JWTKey) Reload

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

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

func (*JWTKey) Update

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

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

func (o *JWTKey) 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 JWTKeyHook

type JWTKeyHook func(context.Context, boil.ContextExecutor, *JWTKey) error

JWTKeyHook is the signature for custom JWTKey hook methods

type JWTKeySlice

type JWTKeySlice []*JWTKey

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

func (JWTKeySlice) DeleteAll

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

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

func (*JWTKeySlice) ReloadAll

func (o *JWTKeySlice) 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 (JWTKeySlice) UpdateAll

func (o JWTKeySlice) 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 Password

type Password struct {
	ID        int       `boil:"id" json:"id" toml:"id" yaml:"id"`
	UserID    int       `boil:"user_id" json:"user_id" toml:"user_id" yaml:"user_id"`
	CreatedAt time.Time `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"`
	UpdatedAt time.Time `boil:"updated_at" json:"updated_at" toml:"updated_at" yaml:"updated_at"`
	Salt      []byte    `boil:"salt" json:"salt" toml:"salt" yaml:"salt"`
	Hash      []byte    `boil:"hash" json:"hash" toml:"hash" yaml:"hash"`

	R *passwordR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L passwordL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Password is an object representing the database table.

func FindPassword

func FindPassword(ctx context.Context, exec boil.ContextExecutor, iD int, selectCols ...string) (*Password, error)

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

func (*Password) Delete

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

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

func (*Password) Insert

func (o *Password) 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 (*Password) Reload

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

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

func (*Password) SetUser

func (o *Password) SetUser(ctx context.Context, exec boil.ContextExecutor, insert bool, related *User) error

SetUser of the password to the related item. Sets o.R.User to related. Adds o to related.R.Password.

func (*Password) Update

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

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

func (o *Password) 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.

func (*Password) User

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

User pointed to by the foreign key.

type PasswordHook

type PasswordHook func(context.Context, boil.ContextExecutor, *Password) error

PasswordHook is the signature for custom Password hook methods

type PasswordSlice

type PasswordSlice []*Password

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

func (PasswordSlice) DeleteAll

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

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

func (*PasswordSlice) ReloadAll

func (o *PasswordSlice) 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 (PasswordSlice) UpdateAll

func (o PasswordSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, 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"`
	Email     string    `boil:"email" json:"email" toml:"email" yaml:"email"`
	Name      string    `boil:"name" json:"name" toml:"name" yaml:"name"`
	CreatedAt time.Time `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"`
	UpdatedAt time.Time `boil:"updated_at" json:"updated_at" toml:"updated_at" yaml:"updated_at"`

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

func (o *User) AddAudiences(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Audience) error

AddAudiences adds the given related objects to the existing relationships of the user, optionally inserting them as new records. Appends related to o.R.Audiences. Sets related.R.Users appropriately.

func (*User) AddGroups

func (o *User) AddGroups(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Group) error

AddGroups adds the given related objects to the existing relationships of the user, optionally inserting them as new records. Appends related to o.R.Groups. Sets related.R.Users appropriately.

func (*User) Audiences

func (o *User) Audiences(mods ...qm.QueryMod) audienceQuery

Audiences retrieves all the audience's Audiences with an executor.

func (*User) Delete

func (o *User) Delete(ctx context.Context, exec boil.ContextExecutor) (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) Groups

func (o *User) Groups(mods ...qm.QueryMod) groupQuery

Groups retrieves all the group's Groups with an executor.

func (*User) Insert

func (o *User) 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 (*User) Password

func (o *User) Password(mods ...qm.QueryMod) passwordQuery

Password pointed to by the foreign key.

func (*User) Reload

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

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

func (*User) RemoveAudiences

func (o *User) RemoveAudiences(ctx context.Context, exec boil.ContextExecutor, related ...*Audience) error

RemoveAudiences relationships from objects passed in. Removes related items from R.Audiences (uses pointer comparison, removal does not keep order) Sets related.R.Users.

func (*User) RemoveGroups

func (o *User) RemoveGroups(ctx context.Context, exec boil.ContextExecutor, related ...*Group) error

RemoveGroups relationships from objects passed in. Removes related items from R.Groups (uses pointer comparison, removal does not keep order) Sets related.R.Users.

func (*User) SetAudiences

func (o *User) SetAudiences(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Audience) error

SetAudiences removes all previously related items of the user replacing them completely with the passed in related items, optionally inserting them as new records. Sets o.R.Users's Audiences accordingly. Replaces o.R.Audiences with related. Sets related.R.Users's Audiences accordingly.

func (*User) SetGroups

func (o *User) SetGroups(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Group) error

SetGroups removes all previously related items of the user replacing them completely with the passed in related items, optionally inserting them as new records. Sets o.R.Users's Groups accordingly. Replaces o.R.Groups with related. Sets related.R.Users's Groups accordingly.

func (*User) SetPassword

func (o *User) SetPassword(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Password) error

SetPassword of the user to the related item. Sets o.R.Password to related. Adds o to related.R.User.

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 UserHook

type UserHook func(context.Context, boil.ContextExecutor, *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(ctx context.Context, exec boil.ContextExecutor) (int64, error)

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

func (*UserSlice) ReloadAll

func (o *UserSlice) 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 (UserSlice) UpdateAll

func (o UserSlice) 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