Documentation ¶
Index ¶
- Constants
- Variables
- func ErrorConstraint(err error) string
- func GroupCriteriaWhereClause(comp *Composer, c *GroupCriteria, id int) error
- func GroupPermissionsCriteriaWhereClause(comp *Composer, c *GroupPermissionsCriteria, id int) error
- func PermissionCriteriaWhereClause(comp *Composer, c *PermissionCriteria, id int) error
- func QueryFloat64WhereClause(i *qtypes.Float64, id int, sel string, com *Composer, opt *CompositionOpts) (err error)
- func QueryInt64WhereClause(i *qtypes.Int64, id int, sel string, com *Composer, opt *CompositionOpts) (err error)
- func QueryStringWhereClause(i *qtypes.String, id int, sel string, com *Composer, opt *CompositionOpts) (err error)
- func QueryTimestampWhereClause(i *qtypes.Timestamp, id int, sel string, com *Composer, opt *CompositionOpts) (err error)
- func RefreshTokenCriteriaWhereClause(comp *Composer, c *RefreshTokenCriteria, id int) error
- func RunInTransaction(ctx context.Context, db *sql.DB, f func(tx *sql.Tx) error, attempts int) (err error)
- func UserCriteriaWhereClause(comp *Composer, c *UserCriteria, id int) error
- func UserGroupsCriteriaWhereClause(comp *Composer, c *UserGroupsCriteria, id int) error
- func UserPermissionsCriteriaWhereClause(comp *Composer, c *UserPermissionsCriteria, id int) error
- type Composer
- func (c *Composer) Add(arg interface{})
- func (c *Composer) Args() []interface{}
- func (c *Composer) Len() int
- func (c *Composer) Read(b []byte) (int, error)
- func (c *Composer) ResetBuf()
- func (c *Composer) String() string
- func (c *Composer) Write(b []byte) (int, error)
- func (c *Composer) WriteAlias(i int) error
- func (c *Composer) WritePlaceholder() error
- func (c *Composer) WriteString(s string) (int, error)
- type CompositionOpts
- type CompositionWriter
- type GroupCountExpr
- type GroupCriteria
- type GroupEntity
- type GroupFindExpr
- type GroupIterator
- type GroupJoin
- type GroupPatch
- type GroupPermissionsCountExpr
- type GroupPermissionsCriteria
- type GroupPermissionsEntity
- type GroupPermissionsFindExpr
- type GroupPermissionsIterator
- func (i *GroupPermissionsIterator) Close() error
- func (i *GroupPermissionsIterator) Columns() ([]string, error)
- func (i *GroupPermissionsIterator) Ent() (interface{}, error)
- func (i *GroupPermissionsIterator) Err() error
- func (i *GroupPermissionsIterator) GroupPermissions() (*GroupPermissionsEntity, error)
- func (i *GroupPermissionsIterator) Next() bool
- type GroupPermissionsJoin
- type GroupPermissionsPatch
- type GroupPermissionsProvider
- type GroupPermissionsRepository
- type GroupPermissionsRepositoryBase
- func (r *GroupPermissionsRepositoryBase) BeginTx(ctx context.Context) (*GroupPermissionsRepositoryBaseTx, error)
- func (r *GroupPermissionsRepositoryBase) Count(ctx context.Context, exp *GroupPermissionsCountExpr) (int64, error)
- func (r *GroupPermissionsRepositoryBase) Find(ctx context.Context, fe *GroupPermissionsFindExpr) ([]*GroupPermissionsEntity, error)
- func (r *GroupPermissionsRepositoryBase) FindIter(ctx context.Context, fe *GroupPermissionsFindExpr) (*GroupPermissionsIterator, error)
- func (r *GroupPermissionsRepositoryBase) FindOneByGroupIDAndPermissionSubsystemAndPermissionModuleAndPermissionAction(ctx context.Context, groupPermissionsGroupID int64, ...) (*GroupPermissionsEntity, error)
- func (r *GroupPermissionsRepositoryBase) FindQuery(fe *GroupPermissionsFindExpr) (string, []interface{}, error)
- func (r *GroupPermissionsRepositoryBase) Insert(ctx context.Context, e *GroupPermissionsEntity) (*GroupPermissionsEntity, error)
- func (r *GroupPermissionsRepositoryBase) InsertQuery(e *GroupPermissionsEntity, read bool) (string, []interface{}, error)
- func (r GroupPermissionsRepositoryBase) RunInTransaction(ctx context.Context, fn func(rtx *GroupPermissionsRepositoryBaseTx) error, ...) (err error)
- func (r *GroupPermissionsRepositoryBase) Tx(tx *sql.Tx) (*GroupPermissionsRepositoryBaseTx, error)
- func (r *GroupPermissionsRepositoryBase) UpdateOneByGroupIDAndPermissionSubsystemAndPermissionModuleAndPermissionAction(ctx context.Context, groupPermissionsGroupID int64, ...) (*GroupPermissionsEntity, error)
- func (r *GroupPermissionsRepositoryBase) UpdateOneByGroupIDAndPermissionSubsystemAndPermissionModuleAndPermissionActionQuery(groupPermissionsGroupID int64, groupPermissionsPermissionSubsystem string, ...) (string, []interface{}, error)
- func (r *GroupPermissionsRepositoryBase) Upsert(ctx context.Context, e *GroupPermissionsEntity, p *GroupPermissionsPatch, ...) (*GroupPermissionsEntity, error)
- func (r *GroupPermissionsRepositoryBase) UpsertQuery(e *GroupPermissionsEntity, p *GroupPermissionsPatch, inf ...string) (string, []interface{}, error)
- type GroupPermissionsRepositoryBaseTx
- func (r GroupPermissionsRepositoryBaseTx) Commit() error
- func (r *GroupPermissionsRepositoryBaseTx) Count(ctx context.Context, exp *GroupPermissionsCountExpr) (int64, error)
- func (r *GroupPermissionsRepositoryBaseTx) Find(ctx context.Context, fe *GroupPermissionsFindExpr) ([]*GroupPermissionsEntity, error)
- func (r *GroupPermissionsRepositoryBaseTx) FindIter(ctx context.Context, fe *GroupPermissionsFindExpr) (*GroupPermissionsIterator, error)
- func (r *GroupPermissionsRepositoryBaseTx) Insert(ctx context.Context, e *GroupPermissionsEntity) (*GroupPermissionsEntity, error)
- func (r GroupPermissionsRepositoryBaseTx) Rollback() error
- func (r *GroupPermissionsRepositoryBaseTx) UpdateOneByGroupIDAndPermissionSubsystemAndPermissionModuleAndPermissionAction(ctx context.Context, groupPermissionsGroupID int64, ...) (*GroupPermissionsEntity, error)
- func (r *GroupPermissionsRepositoryBaseTx) Upsert(ctx context.Context, e *GroupPermissionsEntity, p *GroupPermissionsPatch, ...) (*GroupPermissionsEntity, error)
- type GroupProvider
- type GroupRepository
- func (gr *GroupRepository) Create(ctx context.Context, createdBy int64, name string, description *ntypes.String) (ent *GroupEntity, err error)
- func (gr *GroupRepository) FindByUserID(ctx context.Context, userID int64) ([]*GroupEntity, error)
- func (gr *GroupRepository) IsGranted(ctx context.Context, id int64, p charon.Permission) (bool, error)
- func (gr *GroupRepository) SetPermissions(ctx context.Context, id int64, p ...charon.Permission) (int64, int64, error)
- type GroupRepositoryBase
- func (r *GroupRepositoryBase) BeginTx(ctx context.Context) (*GroupRepositoryBaseTx, error)
- func (r *GroupRepositoryBase) Count(ctx context.Context, exp *GroupCountExpr) (int64, error)
- func (r *GroupRepositoryBase) DeleteOneByID(ctx context.Context, pk int64) (int64, error)
- func (r *GroupRepositoryBase) Find(ctx context.Context, fe *GroupFindExpr) ([]*GroupEntity, error)
- func (r *GroupRepositoryBase) FindIter(ctx context.Context, fe *GroupFindExpr) (*GroupIterator, error)
- func (r *GroupRepositoryBase) FindOneByID(ctx context.Context, pk int64) (*GroupEntity, error)
- func (r *GroupRepositoryBase) FindOneByIDAndUpdate(ctx context.Context, pk int64, p *GroupPatch) (before, after *GroupEntity, err error)
- func (r *GroupRepositoryBase) FindOneByName(ctx context.Context, groupName string) (*GroupEntity, error)
- func (r *GroupRepositoryBase) FindQuery(fe *GroupFindExpr) (string, []interface{}, error)
- func (r *GroupRepositoryBase) Insert(ctx context.Context, e *GroupEntity) (*GroupEntity, error)
- func (r *GroupRepositoryBase) InsertQuery(e *GroupEntity, read bool) (string, []interface{}, error)
- func (r GroupRepositoryBase) RunInTransaction(ctx context.Context, fn func(rtx *GroupRepositoryBaseTx) error, attempts int) (err error)
- func (r *GroupRepositoryBase) Tx(tx *sql.Tx) (*GroupRepositoryBaseTx, error)
- func (r *GroupRepositoryBase) UpdateOneByID(ctx context.Context, pk int64, p *GroupPatch) (*GroupEntity, error)
- func (r *GroupRepositoryBase) UpdateOneByIDQuery(pk int64, p *GroupPatch) (string, []interface{}, error)
- func (r *GroupRepositoryBase) UpdateOneByName(ctx context.Context, groupName string, p *GroupPatch) (*GroupEntity, error)
- func (r *GroupRepositoryBase) UpdateOneByNameQuery(groupName string, p *GroupPatch) (string, []interface{}, error)
- func (r *GroupRepositoryBase) Upsert(ctx context.Context, e *GroupEntity, p *GroupPatch, inf ...string) (*GroupEntity, error)
- func (r *GroupRepositoryBase) UpsertQuery(e *GroupEntity, p *GroupPatch, inf ...string) (string, []interface{}, error)
- type GroupRepositoryBaseTx
- func (r GroupRepositoryBaseTx) Commit() error
- func (r *GroupRepositoryBaseTx) Count(ctx context.Context, exp *GroupCountExpr) (int64, error)
- func (r *GroupRepositoryBaseTx) DeleteOneByID(ctx context.Context, pk int64) (int64, error)
- func (r *GroupRepositoryBaseTx) Find(ctx context.Context, fe *GroupFindExpr) ([]*GroupEntity, error)
- func (r *GroupRepositoryBaseTx) FindIter(ctx context.Context, fe *GroupFindExpr) (*GroupIterator, error)
- func (r *GroupRepositoryBaseTx) FindOneByID(ctx context.Context, pk int64) (*GroupEntity, error)
- func (r *GroupRepositoryBaseTx) Insert(ctx context.Context, e *GroupEntity) (*GroupEntity, error)
- func (r GroupRepositoryBaseTx) Rollback() error
- func (r *GroupRepositoryBaseTx) UpdateOneByID(ctx context.Context, pk int64, p *GroupPatch) (*GroupEntity, error)
- func (r *GroupRepositoryBaseTx) UpdateOneByName(ctx context.Context, groupName string, p *GroupPatch) (*GroupEntity, error)
- func (r *GroupRepositoryBaseTx) Upsert(ctx context.Context, e *GroupEntity, p *GroupPatch, inf ...string) (*GroupEntity, error)
- type JSONArrayFloat64
- type JSONArrayInt64
- type JSONArrayString
- type JoinType
- type LogFunc
- type NullBoolArray
- type NullByteaArray
- type NullFloat64Array
- type NullInt64Array
- type NullStringArray
- type PermissionCountExpr
- type PermissionCriteria
- type PermissionEntity
- type PermissionFindExpr
- type PermissionIterator
- func (i *PermissionIterator) Close() error
- func (i *PermissionIterator) Columns() ([]string, error)
- func (i *PermissionIterator) Ent() (interface{}, error)
- func (i *PermissionIterator) Err() error
- func (i *PermissionIterator) Next() bool
- func (i *PermissionIterator) Permission() (*PermissionEntity, error)
- type PermissionJoin
- type PermissionPatch
- type PermissionProvider
- type PermissionReg
- type PermissionRegistry
- type PermissionRepository
- func (pr *PermissionRepository) FindBy(ctx context.Context, query string, args ...interface{}) ([]*PermissionEntity, error)
- func (pr *PermissionRepository) FindByGroupID(ctx context.Context, groupID int64) ([]*PermissionEntity, error)
- func (pr *PermissionRepository) FindByTag(ctx context.Context, userID int64) ([]*PermissionEntity, error)
- func (pr *PermissionRepository) FindByUserID(ctx context.Context, userID int64) ([]*PermissionEntity, error)
- func (pr *PermissionRepository) InsertMissing(ctx context.Context, permissions charon.Permissions) (int64, error)
- func (pr *PermissionRepository) Register(ctx context.Context, permissions charon.Permissions) (created, unt, removed int64, err error)
- type PermissionRepositoryBase
- func (r *PermissionRepositoryBase) BeginTx(ctx context.Context) (*PermissionRepositoryBaseTx, error)
- func (r *PermissionRepositoryBase) Count(ctx context.Context, exp *PermissionCountExpr) (int64, error)
- func (r *PermissionRepositoryBase) DeleteOneByID(ctx context.Context, pk int64) (int64, error)
- func (r *PermissionRepositoryBase) Find(ctx context.Context, fe *PermissionFindExpr) ([]*PermissionEntity, error)
- func (r *PermissionRepositoryBase) FindIter(ctx context.Context, fe *PermissionFindExpr) (*PermissionIterator, error)
- func (r *PermissionRepositoryBase) FindOneByID(ctx context.Context, pk int64) (*PermissionEntity, error)
- func (r *PermissionRepositoryBase) FindOneByIDAndUpdate(ctx context.Context, pk int64, p *PermissionPatch) (before, after *PermissionEntity, err error)
- func (r *PermissionRepositoryBase) FindOneBySubsystemAndModuleAndAction(ctx context.Context, permissionSubsystem string, permissionModule string, ...) (*PermissionEntity, error)
- func (r *PermissionRepositoryBase) FindQuery(fe *PermissionFindExpr) (string, []interface{}, error)
- func (r *PermissionRepositoryBase) Insert(ctx context.Context, e *PermissionEntity) (*PermissionEntity, error)
- func (r *PermissionRepositoryBase) InsertQuery(e *PermissionEntity, read bool) (string, []interface{}, error)
- func (r PermissionRepositoryBase) RunInTransaction(ctx context.Context, fn func(rtx *PermissionRepositoryBaseTx) error, ...) (err error)
- func (r *PermissionRepositoryBase) Tx(tx *sql.Tx) (*PermissionRepositoryBaseTx, error)
- func (r *PermissionRepositoryBase) UpdateOneByID(ctx context.Context, pk int64, p *PermissionPatch) (*PermissionEntity, error)
- func (r *PermissionRepositoryBase) UpdateOneByIDQuery(pk int64, p *PermissionPatch) (string, []interface{}, error)
- func (r *PermissionRepositoryBase) UpdateOneBySubsystemAndModuleAndAction(ctx context.Context, permissionSubsystem string, permissionModule string, ...) (*PermissionEntity, error)
- func (r *PermissionRepositoryBase) UpdateOneBySubsystemAndModuleAndActionQuery(permissionSubsystem string, permissionModule string, permissionAction string, ...) (string, []interface{}, error)
- func (r *PermissionRepositoryBase) Upsert(ctx context.Context, e *PermissionEntity, p *PermissionPatch, inf ...string) (*PermissionEntity, error)
- func (r *PermissionRepositoryBase) UpsertQuery(e *PermissionEntity, p *PermissionPatch, inf ...string) (string, []interface{}, error)
- type PermissionRepositoryBaseTx
- func (r PermissionRepositoryBaseTx) Commit() error
- func (r *PermissionRepositoryBaseTx) Count(ctx context.Context, exp *PermissionCountExpr) (int64, error)
- func (r *PermissionRepositoryBaseTx) DeleteOneByID(ctx context.Context, pk int64) (int64, error)
- func (r *PermissionRepositoryBaseTx) Find(ctx context.Context, fe *PermissionFindExpr) ([]*PermissionEntity, error)
- func (r *PermissionRepositoryBaseTx) FindIter(ctx context.Context, fe *PermissionFindExpr) (*PermissionIterator, error)
- func (r *PermissionRepositoryBaseTx) FindOneByID(ctx context.Context, pk int64) (*PermissionEntity, error)
- func (r *PermissionRepositoryBaseTx) Insert(ctx context.Context, e *PermissionEntity) (*PermissionEntity, error)
- func (r PermissionRepositoryBaseTx) Rollback() error
- func (r *PermissionRepositoryBaseTx) UpdateOneByID(ctx context.Context, pk int64, p *PermissionPatch) (*PermissionEntity, error)
- func (r *PermissionRepositoryBaseTx) UpdateOneBySubsystemAndModuleAndAction(ctx context.Context, permissionSubsystem string, permissionModule string, ...) (*PermissionEntity, error)
- func (r *PermissionRepositoryBaseTx) Upsert(ctx context.Context, e *PermissionEntity, p *PermissionPatch, inf ...string) (*PermissionEntity, error)
- type RefreshTokenCountExpr
- type RefreshTokenCriteria
- type RefreshTokenEntity
- type RefreshTokenFindExpr
- type RefreshTokenIterator
- func (i *RefreshTokenIterator) Close() error
- func (i *RefreshTokenIterator) Columns() ([]string, error)
- func (i *RefreshTokenIterator) Ent() (interface{}, error)
- func (i *RefreshTokenIterator) Err() error
- func (i *RefreshTokenIterator) Next() bool
- func (i *RefreshTokenIterator) RefreshToken() (*RefreshTokenEntity, error)
- type RefreshTokenJoin
- type RefreshTokenPatch
- type RefreshTokenProvider
- type RefreshTokenRepository
- type RefreshTokenRepositoryBase
- func (r *RefreshTokenRepositoryBase) BeginTx(ctx context.Context) (*RefreshTokenRepositoryBaseTx, error)
- func (r *RefreshTokenRepositoryBase) Count(ctx context.Context, exp *RefreshTokenCountExpr) (int64, error)
- func (r *RefreshTokenRepositoryBase) Find(ctx context.Context, fe *RefreshTokenFindExpr) ([]*RefreshTokenEntity, error)
- func (r *RefreshTokenRepositoryBase) FindIter(ctx context.Context, fe *RefreshTokenFindExpr) (*RefreshTokenIterator, error)
- func (r *RefreshTokenRepositoryBase) FindOneByToken(ctx context.Context, refreshTokenToken string) (*RefreshTokenEntity, error)
- func (r *RefreshTokenRepositoryBase) FindQuery(fe *RefreshTokenFindExpr) (string, []interface{}, error)
- func (r *RefreshTokenRepositoryBase) Insert(ctx context.Context, e *RefreshTokenEntity) (*RefreshTokenEntity, error)
- func (r *RefreshTokenRepositoryBase) InsertQuery(e *RefreshTokenEntity, read bool) (string, []interface{}, error)
- func (r RefreshTokenRepositoryBase) RunInTransaction(ctx context.Context, fn func(rtx *RefreshTokenRepositoryBaseTx) error, ...) (err error)
- func (r *RefreshTokenRepositoryBase) Tx(tx *sql.Tx) (*RefreshTokenRepositoryBaseTx, error)
- func (r *RefreshTokenRepositoryBase) UpdateOneByToken(ctx context.Context, refreshTokenToken string, p *RefreshTokenPatch) (*RefreshTokenEntity, error)
- func (r *RefreshTokenRepositoryBase) UpdateOneByTokenQuery(refreshTokenToken string, p *RefreshTokenPatch) (string, []interface{}, error)
- func (r *RefreshTokenRepositoryBase) Upsert(ctx context.Context, e *RefreshTokenEntity, p *RefreshTokenPatch, ...) (*RefreshTokenEntity, error)
- func (r *RefreshTokenRepositoryBase) UpsertQuery(e *RefreshTokenEntity, p *RefreshTokenPatch, inf ...string) (string, []interface{}, error)
- type RefreshTokenRepositoryBaseTx
- func (r RefreshTokenRepositoryBaseTx) Commit() error
- func (r *RefreshTokenRepositoryBaseTx) Count(ctx context.Context, exp *RefreshTokenCountExpr) (int64, error)
- func (r *RefreshTokenRepositoryBaseTx) Find(ctx context.Context, fe *RefreshTokenFindExpr) ([]*RefreshTokenEntity, error)
- func (r *RefreshTokenRepositoryBaseTx) FindIter(ctx context.Context, fe *RefreshTokenFindExpr) (*RefreshTokenIterator, error)
- func (r *RefreshTokenRepositoryBaseTx) Insert(ctx context.Context, e *RefreshTokenEntity) (*RefreshTokenEntity, error)
- func (r RefreshTokenRepositoryBaseTx) Rollback() error
- func (r *RefreshTokenRepositoryBaseTx) UpdateOneByToken(ctx context.Context, refreshTokenToken string, p *RefreshTokenPatch) (*RefreshTokenEntity, error)
- func (r *RefreshTokenRepositoryBaseTx) Upsert(ctx context.Context, e *RefreshTokenEntity, p *RefreshTokenPatch, ...) (*RefreshTokenEntity, error)
- type RowOrder
- type Rows
- type UserCountExpr
- type UserCriteria
- type UserEntity
- type UserFindExpr
- type UserGroupsCountExpr
- type UserGroupsCriteria
- type UserGroupsEntity
- type UserGroupsFindExpr
- type UserGroupsIterator
- func (i *UserGroupsIterator) Close() error
- func (i *UserGroupsIterator) Columns() ([]string, error)
- func (i *UserGroupsIterator) Ent() (interface{}, error)
- func (i *UserGroupsIterator) Err() error
- func (i *UserGroupsIterator) Next() bool
- func (i *UserGroupsIterator) UserGroups() (*UserGroupsEntity, error)
- type UserGroupsJoin
- type UserGroupsPatch
- type UserGroupsProvider
- type UserGroupsRepository
- func (ugr *UserGroupsRepository) DeleteByUserID(ctx context.Context, id int64) (int64, error)
- func (ugr *UserGroupsRepository) Exists(ctx context.Context, userID, groupID int64) (bool, error)
- func (ugr *UserGroupsRepository) Set(ctx context.Context, userID int64, groupIDs []int64) (int64, int64, error)
- type UserGroupsRepositoryBase
- func (r *UserGroupsRepositoryBase) BeginTx(ctx context.Context) (*UserGroupsRepositoryBaseTx, error)
- func (r *UserGroupsRepositoryBase) Count(ctx context.Context, exp *UserGroupsCountExpr) (int64, error)
- func (r *UserGroupsRepositoryBase) Find(ctx context.Context, fe *UserGroupsFindExpr) ([]*UserGroupsEntity, error)
- func (r *UserGroupsRepositoryBase) FindIter(ctx context.Context, fe *UserGroupsFindExpr) (*UserGroupsIterator, error)
- func (r *UserGroupsRepositoryBase) FindOneByUserIDAndGroupID(ctx context.Context, userGroupsUserID int64, userGroupsGroupID int64) (*UserGroupsEntity, error)
- func (r *UserGroupsRepositoryBase) FindQuery(fe *UserGroupsFindExpr) (string, []interface{}, error)
- func (r *UserGroupsRepositoryBase) Insert(ctx context.Context, e *UserGroupsEntity) (*UserGroupsEntity, error)
- func (r *UserGroupsRepositoryBase) InsertQuery(e *UserGroupsEntity, read bool) (string, []interface{}, error)
- func (r UserGroupsRepositoryBase) RunInTransaction(ctx context.Context, fn func(rtx *UserGroupsRepositoryBaseTx) error, ...) (err error)
- func (r *UserGroupsRepositoryBase) Tx(tx *sql.Tx) (*UserGroupsRepositoryBaseTx, error)
- func (r *UserGroupsRepositoryBase) UpdateOneByUserIDAndGroupID(ctx context.Context, userGroupsUserID int64, userGroupsGroupID int64, ...) (*UserGroupsEntity, error)
- func (r *UserGroupsRepositoryBase) UpdateOneByUserIDAndGroupIDQuery(userGroupsUserID int64, userGroupsGroupID int64, p *UserGroupsPatch) (string, []interface{}, error)
- func (r *UserGroupsRepositoryBase) Upsert(ctx context.Context, e *UserGroupsEntity, p *UserGroupsPatch, inf ...string) (*UserGroupsEntity, error)
- func (r *UserGroupsRepositoryBase) UpsertQuery(e *UserGroupsEntity, p *UserGroupsPatch, inf ...string) (string, []interface{}, error)
- type UserGroupsRepositoryBaseTx
- func (r UserGroupsRepositoryBaseTx) Commit() error
- func (r *UserGroupsRepositoryBaseTx) Count(ctx context.Context, exp *UserGroupsCountExpr) (int64, error)
- func (r *UserGroupsRepositoryBaseTx) Find(ctx context.Context, fe *UserGroupsFindExpr) ([]*UserGroupsEntity, error)
- func (r *UserGroupsRepositoryBaseTx) FindIter(ctx context.Context, fe *UserGroupsFindExpr) (*UserGroupsIterator, error)
- func (r *UserGroupsRepositoryBaseTx) Insert(ctx context.Context, e *UserGroupsEntity) (*UserGroupsEntity, error)
- func (r UserGroupsRepositoryBaseTx) Rollback() error
- func (r *UserGroupsRepositoryBaseTx) UpdateOneByUserIDAndGroupID(ctx context.Context, userGroupsUserID int64, userGroupsGroupID int64, ...) (*UserGroupsEntity, error)
- func (r *UserGroupsRepositoryBaseTx) Upsert(ctx context.Context, e *UserGroupsEntity, p *UserGroupsPatch, inf ...string) (*UserGroupsEntity, error)
- type UserIterator
- type UserJoin
- type UserPatch
- type UserPermissionsCountExpr
- type UserPermissionsCriteria
- type UserPermissionsEntity
- type UserPermissionsFindExpr
- type UserPermissionsIterator
- func (i *UserPermissionsIterator) Close() error
- func (i *UserPermissionsIterator) Columns() ([]string, error)
- func (i *UserPermissionsIterator) Ent() (interface{}, error)
- func (i *UserPermissionsIterator) Err() error
- func (i *UserPermissionsIterator) Next() bool
- func (i *UserPermissionsIterator) UserPermissions() (*UserPermissionsEntity, error)
- type UserPermissionsJoin
- type UserPermissionsPatch
- type UserPermissionsProvider
- type UserPermissionsRepository
- type UserPermissionsRepositoryBase
- func (r *UserPermissionsRepositoryBase) BeginTx(ctx context.Context) (*UserPermissionsRepositoryBaseTx, error)
- func (r *UserPermissionsRepositoryBase) Count(ctx context.Context, exp *UserPermissionsCountExpr) (int64, error)
- func (r *UserPermissionsRepositoryBase) Find(ctx context.Context, fe *UserPermissionsFindExpr) ([]*UserPermissionsEntity, error)
- func (r *UserPermissionsRepositoryBase) FindIter(ctx context.Context, fe *UserPermissionsFindExpr) (*UserPermissionsIterator, error)
- func (r *UserPermissionsRepositoryBase) FindOneByUserIDAndPermissionSubsystemAndPermissionModuleAndPermissionAction(ctx context.Context, userPermissionsUserID int64, ...) (*UserPermissionsEntity, error)
- func (r *UserPermissionsRepositoryBase) FindQuery(fe *UserPermissionsFindExpr) (string, []interface{}, error)
- func (r *UserPermissionsRepositoryBase) Insert(ctx context.Context, e *UserPermissionsEntity) (*UserPermissionsEntity, error)
- func (r *UserPermissionsRepositoryBase) InsertQuery(e *UserPermissionsEntity, read bool) (string, []interface{}, error)
- func (r UserPermissionsRepositoryBase) RunInTransaction(ctx context.Context, fn func(rtx *UserPermissionsRepositoryBaseTx) error, ...) (err error)
- func (r *UserPermissionsRepositoryBase) Tx(tx *sql.Tx) (*UserPermissionsRepositoryBaseTx, error)
- func (r *UserPermissionsRepositoryBase) UpdateOneByUserIDAndPermissionSubsystemAndPermissionModuleAndPermissionAction(ctx context.Context, userPermissionsUserID int64, ...) (*UserPermissionsEntity, error)
- func (r *UserPermissionsRepositoryBase) UpdateOneByUserIDAndPermissionSubsystemAndPermissionModuleAndPermissionActionQuery(userPermissionsUserID int64, userPermissionsPermissionSubsystem string, ...) (string, []interface{}, error)
- func (r *UserPermissionsRepositoryBase) Upsert(ctx context.Context, e *UserPermissionsEntity, p *UserPermissionsPatch, ...) (*UserPermissionsEntity, error)
- func (r *UserPermissionsRepositoryBase) UpsertQuery(e *UserPermissionsEntity, p *UserPermissionsPatch, inf ...string) (string, []interface{}, error)
- type UserPermissionsRepositoryBaseTx
- func (r UserPermissionsRepositoryBaseTx) Commit() error
- func (r *UserPermissionsRepositoryBaseTx) Count(ctx context.Context, exp *UserPermissionsCountExpr) (int64, error)
- func (r *UserPermissionsRepositoryBaseTx) Find(ctx context.Context, fe *UserPermissionsFindExpr) ([]*UserPermissionsEntity, error)
- func (r *UserPermissionsRepositoryBaseTx) FindIter(ctx context.Context, fe *UserPermissionsFindExpr) (*UserPermissionsIterator, error)
- func (r *UserPermissionsRepositoryBaseTx) Insert(ctx context.Context, e *UserPermissionsEntity) (*UserPermissionsEntity, error)
- func (r UserPermissionsRepositoryBaseTx) Rollback() error
- func (r *UserPermissionsRepositoryBaseTx) UpdateOneByUserIDAndPermissionSubsystemAndPermissionModuleAndPermissionAction(ctx context.Context, userPermissionsUserID int64, ...) (*UserPermissionsEntity, error)
- func (r *UserPermissionsRepositoryBaseTx) Upsert(ctx context.Context, e *UserPermissionsEntity, p *UserPermissionsPatch, ...) (*UserPermissionsEntity, error)
- type UserProvider
- type UserRepository
- func (ur *UserRepository) ChangePassword(ctx context.Context, userID int64, password string) error
- func (ur *UserRepository) Count(ctx context.Context) (n int64, err error)
- func (ur *UserRepository) Create(ctx context.Context, ent *UserEntity) (*UserEntity, error)
- func (ur *UserRepository) CreateSuperuser(ctx context.Context, username string, password []byte, ...) (*UserEntity, error)
- func (ur *UserRepository) Exists(ctx context.Context, userID int64) (bool, error)
- func (ur *UserRepository) FindOneBy(ctx context.Context, fieldName string, value interface{}) (*UserEntity, error)
- func (ur *UserRepository) FindOneByUsername(ctx context.Context, username string) (*UserEntity, error)
- func (ur *UserRepository) IsGranted(ctx context.Context, id int64, p charon.Permission) (bool, error)
- func (ur *UserRepository) RegistrationConfirmation(ctx context.Context, userID int64, confirmationToken string) (int64, error)
- func (ur *UserRepository) SetPermissions(ctx context.Context, id int64, p ...charon.Permission) (int64, int64, error)
- func (ur *UserRepository) UpdateLastLoginAt(ctx context.Context, userID int64) (int64, error)
- type UserRepositoryBase
- func (r *UserRepositoryBase) BeginTx(ctx context.Context) (*UserRepositoryBaseTx, error)
- func (r *UserRepositoryBase) Count(ctx context.Context, exp *UserCountExpr) (int64, error)
- func (r *UserRepositoryBase) DeleteOneByID(ctx context.Context, pk int64) (int64, error)
- func (r *UserRepositoryBase) Find(ctx context.Context, fe *UserFindExpr) ([]*UserEntity, error)
- func (r *UserRepositoryBase) FindIter(ctx context.Context, fe *UserFindExpr) (*UserIterator, error)
- func (r *UserRepositoryBase) FindOneByID(ctx context.Context, pk int64) (*UserEntity, error)
- func (r *UserRepositoryBase) FindOneByIDAndUpdate(ctx context.Context, pk int64, p *UserPatch) (before, after *UserEntity, err error)
- func (r *UserRepositoryBase) FindOneByUsername(ctx context.Context, userUsername string) (*UserEntity, error)
- func (r *UserRepositoryBase) FindQuery(fe *UserFindExpr) (string, []interface{}, error)
- func (r *UserRepositoryBase) Insert(ctx context.Context, e *UserEntity) (*UserEntity, error)
- func (r *UserRepositoryBase) InsertQuery(e *UserEntity, read bool) (string, []interface{}, error)
- func (r UserRepositoryBase) RunInTransaction(ctx context.Context, fn func(rtx *UserRepositoryBaseTx) error, attempts int) (err error)
- func (r *UserRepositoryBase) Tx(tx *sql.Tx) (*UserRepositoryBaseTx, error)
- func (r *UserRepositoryBase) UpdateOneByID(ctx context.Context, pk int64, p *UserPatch) (*UserEntity, error)
- func (r *UserRepositoryBase) UpdateOneByIDQuery(pk int64, p *UserPatch) (string, []interface{}, error)
- func (r *UserRepositoryBase) UpdateOneByUsername(ctx context.Context, userUsername string, p *UserPatch) (*UserEntity, error)
- func (r *UserRepositoryBase) UpdateOneByUsernameQuery(userUsername string, p *UserPatch) (string, []interface{}, error)
- func (r *UserRepositoryBase) Upsert(ctx context.Context, e *UserEntity, p *UserPatch, inf ...string) (*UserEntity, error)
- func (r *UserRepositoryBase) UpsertQuery(e *UserEntity, p *UserPatch, inf ...string) (string, []interface{}, error)
- type UserRepositoryBaseTx
- func (r UserRepositoryBaseTx) Commit() error
- func (r *UserRepositoryBaseTx) Count(ctx context.Context, exp *UserCountExpr) (int64, error)
- func (r *UserRepositoryBaseTx) DeleteOneByID(ctx context.Context, pk int64) (int64, error)
- func (r *UserRepositoryBaseTx) Find(ctx context.Context, fe *UserFindExpr) ([]*UserEntity, error)
- func (r *UserRepositoryBaseTx) FindIter(ctx context.Context, fe *UserFindExpr) (*UserIterator, error)
- func (r *UserRepositoryBaseTx) FindOneByID(ctx context.Context, pk int64) (*UserEntity, error)
- func (r *UserRepositoryBaseTx) Insert(ctx context.Context, e *UserEntity) (*UserEntity, error)
- func (r UserRepositoryBaseTx) Rollback() error
- func (r *UserRepositoryBaseTx) UpdateOneByID(ctx context.Context, pk int64, p *UserPatch) (*UserEntity, error)
- func (r *UserRepositoryBaseTx) UpdateOneByUsername(ctx context.Context, userUsername string, p *UserPatch) (*UserEntity, error)
- func (r *UserRepositoryBaseTx) Upsert(ctx context.Context, e *UserEntity, p *UserPatch, inf ...string) (*UserEntity, error)
Constants ¶
const ( TableUserConstraintPrimaryKey = "charon.user_id_pkey" TableUserConstraintUsernameUnique = "charon.user_username_key" TableUserConstraintCreatedByForeignKey = "charon.user_created_by_fkey" TableUserConstraintUpdatedByForeignKey = "charon.user_updated_by_fkey" )
const ( TableUser = "charon.user" TableUserColumnConfirmationToken = "confirmation_token" TableUserColumnCreatedAt = "created_at" TableUserColumnCreatedBy = "created_by" TableUserColumnFirstName = "first_name" TableUserColumnID = "id" TableUserColumnIsActive = "is_active" TableUserColumnIsConfirmed = "is_confirmed" TableUserColumnIsStaff = "is_staff" TableUserColumnIsSuperuser = "is_superuser" TableUserColumnLastLoginAt = "last_login_at" TableUserColumnLastName = "last_name" TableUserColumnPassword = "password" TableUserColumnUpdatedAt = "updated_at" TableUserColumnUpdatedBy = "updated_by" TableUserColumnUsername = "username" )
const ( TableGroupConstraintNameUnique = "charon.group_name_key" TableGroupConstraintPrimaryKey = "charon.group_id_pkey" TableGroupConstraintCreatedByForeignKey = "charon.group_created_by_fkey" TableGroupConstraintUpdatedByForeignKey = "charon.group_updated_by_fkey" )
const ( TableGroup = "charon.group" TableGroupColumnCreatedAt = "created_at" TableGroupColumnCreatedBy = "created_by" TableGroupColumnDescription = "description" TableGroupColumnID = "id" TableGroupColumnName = "name" TableGroupColumnUpdatedAt = "updated_at" TableGroupColumnUpdatedBy = "updated_by" )
const ( TablePermissionConstraintSubsystemModuleActionUnique = "charon.permission_subsystem_module_action_key" TablePermissionConstraintPrimaryKey = "charon.permission_id_pkey" )
const ( TablePermission = "charon.permission" TablePermissionColumnAction = "action" TablePermissionColumnCreatedAt = "created_at" TablePermissionColumnID = "id" TablePermissionColumnModule = "module" TablePermissionColumnSubsystem = "subsystem" TablePermissionColumnUpdatedAt = "updated_at" )
const ( TableUserGroupsConstraintUserIDForeignKey = "charon.user_groups_user_id_fkey" TableUserGroupsConstraintGroupIDForeignKey = "charon.user_groups_group_id_fkey" TableUserGroupsConstraintUserIDGroupIDUnique = "charon.user_groups_user_id_group_id_key" TableUserGroupsConstraintCreatedByForeignKey = "charon.user_groups_created_by_fkey" TableUserGroupsConstraintUpdatedByForeignKey = "charon.user_groups_updated_by_fkey" )
const ( TableUserGroups = "charon.user_groups" TableUserGroupsColumnCreatedAt = "created_at" TableUserGroupsColumnCreatedBy = "created_by" TableUserGroupsColumnGroupID = "group_id" TableUserGroupsColumnUpdatedAt = "updated_at" TableUserGroupsColumnUpdatedBy = "updated_by" TableUserGroupsColumnUserID = "user_id" )
const ( TableGroupPermissionsConstraintGroupIDForeignKey = "charon.group_permissions_group_id_fkey" TableGroupPermissionsConstraintPermissionSubsystemPermissionModulePermissionActionForeignKey = "charon.group_permissions_subsystem_module_action_fkey" TableGroupPermissionsConstraintGroupIDPermissionSubsystemPermissionModulePermissionActionUnique = "charon.group_permissions_group_id_subsystem_module_action_key" TableGroupPermissionsConstraintCreatedByForeignKey = "charon.group_permissions_created_by_fkey" TableGroupPermissionsConstraintUpdatedByForeignKey = "charon.group_permissions_updated_by_fkey" )
const ( TableGroupPermissions = "charon.group_permissions" TableGroupPermissionsColumnCreatedAt = "created_at" TableGroupPermissionsColumnCreatedBy = "created_by" TableGroupPermissionsColumnGroupID = "group_id" TableGroupPermissionsColumnPermissionAction = "permission_action" TableGroupPermissionsColumnPermissionModule = "permission_module" TableGroupPermissionsColumnPermissionSubsystem = "permission_subsystem" TableGroupPermissionsColumnUpdatedAt = "updated_at" TableGroupPermissionsColumnUpdatedBy = "updated_by" )
const ( TableUserPermissionsConstraintUserIDForeignKey = "charon.user_permissions_user_id_fkey" TableUserPermissionsConstraintPermissionSubsystemPermissionModulePermissionActionForeignKey = "charon.user_permissions_subsystem_module_action_fkey" TableUserPermissionsConstraintUserIDPermissionSubsystemPermissionModulePermissionActionUnique = "charon.user_permissions_user_id_subsystem_module_action_key" TableUserPermissionsConstraintCreatedByForeignKey = "charon.user_permissions_created_by_fkey" TableUserPermissionsConstraintUpdatedByForeignKey = "charon.user_permissions_updated_by_fkey" )
const ( TableUserPermissions = "charon.user_permissions" TableUserPermissionsColumnCreatedAt = "created_at" TableUserPermissionsColumnCreatedBy = "created_by" TableUserPermissionsColumnPermissionAction = "permission_action" TableUserPermissionsColumnPermissionModule = "permission_module" TableUserPermissionsColumnPermissionSubsystem = "permission_subsystem" TableUserPermissionsColumnUpdatedAt = "updated_at" TableUserPermissionsColumnUpdatedBy = "updated_by" TableUserPermissionsColumnUserID = "user_id" )
const ( TableRefreshTokenConstraintTokenUnique = "charon.refresh_token_token_key" TableRefreshTokenConstraintUserIDForeignKey = "charon.refresh_token_user_id_fkey" TableRefreshTokenConstraintCreatedByForeignKey = "charon.refresh_token_created_by_fkey" TableRefreshTokenConstraintUpdatedByForeignKey = "charon.refresh_token_updated_by_fkey" )
const ( TableRefreshToken = "charon.refresh_token" TableRefreshTokenColumnCreatedAt = "created_at" TableRefreshTokenColumnCreatedBy = "created_by" TableRefreshTokenColumnExpireAt = "expire_at" TableRefreshTokenColumnLastUsedAt = "last_used_at" TableRefreshTokenColumnNotes = "notes" TableRefreshTokenColumnRevoked = "revoked" TableRefreshTokenColumnToken = "token" TableRefreshTokenColumnUpdatedAt = "updated_at" TableRefreshTokenColumnUpdatedBy = "updated_by" TableRefreshTokenColumnUserID = "user_id" )
const ( JoinInner = iota JoinLeft JoinRight JoinCross JoinDoNot )
const SQL = `` /* 5133-byte string literal not displayed */
const (
// UserConfirmationTokenUsed ...
UserConfirmationTokenUsed = "!"
)
Variables ¶
var ( ErrEmptySliceOfPermissions = errors.New("empty slice, permissions cannot be registered") ErrEmptySubsystem = errors.New("subsystem name is empty string, permissions cannot be registered") ErrorInconsistentSubsystem = errors.New("provided permissions do not belong to one subsystem, permissions cannot be registered") )
var ( // Space is a shorthand composition option that holds space. Space = &CompositionOpts{ Joint: " ", } // And is a shorthand composition option that holds AND operator. And = &CompositionOpts{ Joint: " AND ", } // Or is a shorthand composition option that holds OR operator. Or = &CompositionOpts{ Joint: " OR ", } // Comma is a shorthand composition option that holds comma. Comma = &CompositionOpts{ Joint: ", ", } )
var ( // ExternalPassword is a password that is set when external source of authentication is provided (e.g. LDAP). ExternalPassword = []byte("!") )
var RetryTransaction = errors.New("retry transaction")
RetryTransaction can be returned by user defined function when a transaction is rolled back and logic repeated.
var TableGroupColumns = []string{ TableGroupColumnCreatedAt, TableGroupColumnCreatedBy, TableGroupColumnDescription, TableGroupColumnID, TableGroupColumnName, TableGroupColumnUpdatedAt, TableGroupColumnUpdatedBy, }
var TableGroupPermissionsColumns = []string{ TableGroupPermissionsColumnCreatedAt, TableGroupPermissionsColumnCreatedBy, TableGroupPermissionsColumnGroupID, TableGroupPermissionsColumnPermissionAction, TableGroupPermissionsColumnPermissionModule, TableGroupPermissionsColumnPermissionSubsystem, TableGroupPermissionsColumnUpdatedAt, TableGroupPermissionsColumnUpdatedBy, }
var TablePermissionColumns = []string{ TablePermissionColumnAction, TablePermissionColumnCreatedAt, TablePermissionColumnID, TablePermissionColumnModule, TablePermissionColumnSubsystem, TablePermissionColumnUpdatedAt, }
var TableRefreshTokenColumns = []string{ TableRefreshTokenColumnCreatedAt, TableRefreshTokenColumnCreatedBy, TableRefreshTokenColumnExpireAt, TableRefreshTokenColumnLastUsedAt, TableRefreshTokenColumnNotes, TableRefreshTokenColumnRevoked, TableRefreshTokenColumnToken, TableRefreshTokenColumnUpdatedAt, TableRefreshTokenColumnUpdatedBy, TableRefreshTokenColumnUserID, }
var TableUserColumns = []string{ TableUserColumnConfirmationToken, TableUserColumnCreatedAt, TableUserColumnCreatedBy, TableUserColumnFirstName, TableUserColumnID, TableUserColumnIsActive, TableUserColumnIsConfirmed, TableUserColumnIsStaff, TableUserColumnIsSuperuser, TableUserColumnLastLoginAt, TableUserColumnLastName, TableUserColumnPassword, TableUserColumnUpdatedAt, TableUserColumnUpdatedBy, TableUserColumnUsername, }
var TableUserGroupsColumns = []string{ TableUserGroupsColumnCreatedAt, TableUserGroupsColumnCreatedBy, TableUserGroupsColumnGroupID, TableUserGroupsColumnUpdatedAt, TableUserGroupsColumnUpdatedBy, TableUserGroupsColumnUserID, }
var TableUserPermissionsColumns = []string{ TableUserPermissionsColumnCreatedAt, TableUserPermissionsColumnCreatedBy, TableUserPermissionsColumnPermissionAction, TableUserPermissionsColumnPermissionModule, TableUserPermissionsColumnPermissionSubsystem, TableUserPermissionsColumnUpdatedAt, TableUserPermissionsColumnUpdatedBy, TableUserPermissionsColumnUserID, }
Functions ¶
func ErrorConstraint ¶ added in v0.9.0
ErrorConstraint returns the error constraint of err if it was produced by the pq library. Otherwise, it returns empty string.
func GroupCriteriaWhereClause ¶ added in v0.9.7
func GroupCriteriaWhereClause(comp *Composer, c *GroupCriteria, id int) error
func GroupPermissionsCriteriaWhereClause ¶ added in v0.9.7
func GroupPermissionsCriteriaWhereClause(comp *Composer, c *GroupPermissionsCriteria, id int) error
func PermissionCriteriaWhereClause ¶ added in v0.9.7
func PermissionCriteriaWhereClause(comp *Composer, c *PermissionCriteria, id int) error
func QueryFloat64WhereClause ¶ added in v0.9.0
func QueryInt64WhereClause ¶ added in v0.9.0
func QueryStringWhereClause ¶ added in v0.9.0
func QueryTimestampWhereClause ¶ added in v0.9.0
func RefreshTokenCriteriaWhereClause ¶ added in v0.18.0
func RefreshTokenCriteriaWhereClause(comp *Composer, c *RefreshTokenCriteria, id int) error
func RunInTransaction ¶ added in v0.18.0
func UserCriteriaWhereClause ¶ added in v0.9.7
func UserCriteriaWhereClause(comp *Composer, c *UserCriteria, id int) error
func UserGroupsCriteriaWhereClause ¶ added in v0.9.7
func UserGroupsCriteriaWhereClause(comp *Composer, c *UserGroupsCriteria, id int) error
func UserPermissionsCriteriaWhereClause ¶ added in v0.9.7
func UserPermissionsCriteriaWhereClause(comp *Composer, c *UserPermissionsCriteria, id int) error
Types ¶
type Composer ¶ added in v0.9.0
type Composer struct { Dirty bool // contains filtered or unexported fields }
Composer holds buffer, arguments and placeholders count. In combination with external buffet can be also used to also generate sub-queries. To do that simply write buffer to the parent buffer, composer will hold all arguments and remember number of last placeholder.
func NewComposer ¶ added in v0.9.0
NewComposer allocates new Composer with inner slice of arguments of given size.
func (*Composer) Add ¶ added in v0.9.0
func (c *Composer) Add(arg interface{})
Add appends list with new element.
func (*Composer) Args ¶ added in v0.9.0
func (c *Composer) Args() []interface{}
Args returns all arguments stored as a slice.
func (*Composer) ResetBuf ¶ added in v0.9.0
func (c *Composer) ResetBuf()
ResetBuf resets internal buffer.
func (*Composer) WriteAlias ¶ added in v0.9.7
func (*Composer) WritePlaceholder ¶ added in v0.9.0
WritePlaceholder writes appropriate placeholder to the query buffer based on current state of the composer.
func (*Composer) WriteString ¶ added in v0.9.0
WriteString appends the contents of s to the query buffer, growing the buffer as needed. The return value n is the length of s; err is always nil. If the buffer becomes too large, WriteString will panic with bytes ErrTooLarge.
type CompositionOpts ¶ added in v0.9.0
type CompositionOpts struct { Joint string PlaceholderFuncs, SelectorFuncs []string PlaceholderCast, SelectorCast string IsJSON bool IsDynamic bool }
CompositionOpts is a container for modification that can be applied.
type CompositionWriter ¶ added in v0.9.0
type CompositionWriter interface { // WriteComposition is a function that allow custom struct type to be used as a part of criteria. // It gives possibility to write custom query based on object that implements this interface. WriteComposition(string, *Composer, *CompositionOpts) error }
CompositionWriter is a simple wrapper for WriteComposition function.
type GroupCountExpr ¶ added in v0.9.7
type GroupCountExpr struct { Where *GroupCriteria JoinAuthor *UserJoin JoinModifier *UserJoin }
type GroupCriteria ¶
type GroupCriteria struct { CreatedAt *qtypes.Timestamp CreatedBy *qtypes.Int64 Description *qtypes.String ID *qtypes.Int64 Name *qtypes.String UpdatedAt *qtypes.Timestamp UpdatedBy *qtypes.Int64 // contains filtered or unexported fields }
func GroupAnd ¶ added in v0.18.0
func GroupAnd(operands ...*GroupCriteria) *GroupCriteria
func GroupOperand ¶ added in v0.18.0
func GroupOperand(operator string, operands ...*GroupCriteria) *GroupCriteria
func GroupOr ¶ added in v0.18.0
func GroupOr(operands ...*GroupCriteria) *GroupCriteria
type GroupEntity ¶
type GroupEntity struct { // CreatedAt ... CreatedAt time.Time // CreatedBy ... CreatedBy ntypes.Int64 // Description ... Description ntypes.String // ID ... ID int64 // Name ... Name string // UpdatedAt ... UpdatedAt pq.NullTime // UpdatedBy ... UpdatedBy ntypes.Int64 // Author ... Author *UserEntity // Modifier ... Modifier *UserEntity // Permissions ... Permissions []*PermissionEntity // Users ... Users []*UserEntity }
GroupEntity ...
func ScanGroupRows ¶
func ScanGroupRows(rows Rows) (entities []*GroupEntity, err error)
ScanGroupRows helps to scan rows straight to the slice of entities.
func (*GroupEntity) Prop ¶
func (e *GroupEntity) Prop(cn string) (interface{}, bool)
func (*GroupEntity) Props ¶
func (e *GroupEntity) Props(cns ...string) ([]interface{}, error)
type GroupFindExpr ¶ added in v0.9.7
type GroupIterator ¶
type GroupIterator struct {
// contains filtered or unexported fields
}
GroupIterator is not thread safe.
func (*GroupIterator) Close ¶
func (i *GroupIterator) Close() error
func (*GroupIterator) Columns ¶
func (i *GroupIterator) Columns() ([]string, error)
Columns is wrapper around sql.Rows.Columns method, that also cache output inside iterator.
func (*GroupIterator) Ent ¶
func (i *GroupIterator) Ent() (interface{}, error)
Ent is wrapper around Group method that makes iterator more generic.
func (*GroupIterator) Err ¶
func (i *GroupIterator) Err() error
func (*GroupIterator) Group ¶
func (i *GroupIterator) Group() (*GroupEntity, error)
func (*GroupIterator) Next ¶
func (i *GroupIterator) Next() bool
type GroupJoin ¶ added in v0.9.7
type GroupJoin struct {
On, Where *GroupCriteria
Fetch bool
Kind JoinType
JoinAuthor *UserJoin
JoinModifier *UserJoin
}
type GroupPatch ¶
type GroupPermissionsCountExpr ¶ added in v0.9.7
type GroupPermissionsCountExpr struct { Where *GroupPermissionsCriteria JoinGroup *GroupJoin JoinAuthor *UserJoin JoinModifier *UserJoin }
type GroupPermissionsCriteria ¶
type GroupPermissionsCriteria struct { CreatedAt *qtypes.Timestamp CreatedBy *qtypes.Int64 GroupID *qtypes.Int64 PermissionAction *qtypes.String PermissionModule *qtypes.String PermissionSubsystem *qtypes.String UpdatedAt *qtypes.Timestamp UpdatedBy *qtypes.Int64 // contains filtered or unexported fields }
func GroupPermissionsAnd ¶ added in v0.18.0
func GroupPermissionsAnd(operands ...*GroupPermissionsCriteria) *GroupPermissionsCriteria
func GroupPermissionsOperand ¶ added in v0.18.0
func GroupPermissionsOperand(operator string, operands ...*GroupPermissionsCriteria) *GroupPermissionsCriteria
func GroupPermissionsOr ¶ added in v0.18.0
func GroupPermissionsOr(operands ...*GroupPermissionsCriteria) *GroupPermissionsCriteria
type GroupPermissionsEntity ¶
type GroupPermissionsEntity struct { // CreatedAt ... CreatedAt time.Time // CreatedBy ... CreatedBy ntypes.Int64 // GroupID ... GroupID int64 // PermissionAction ... PermissionAction string // PermissionModule ... PermissionModule string // PermissionSubsystem ... PermissionSubsystem string // UpdatedAt ... UpdatedAt pq.NullTime // UpdatedBy ... UpdatedBy ntypes.Int64 // Group ... Group *GroupEntity // Author ... Author *UserEntity // Modifier ... Modifier *UserEntity }
GroupPermissionsEntity ...
func ScanGroupPermissionsRows ¶
func ScanGroupPermissionsRows(rows Rows) (entities []*GroupPermissionsEntity, err error)
ScanGroupPermissionsRows helps to scan rows straight to the slice of entities.
func (*GroupPermissionsEntity) Prop ¶
func (e *GroupPermissionsEntity) Prop(cn string) (interface{}, bool)
func (*GroupPermissionsEntity) Props ¶
func (e *GroupPermissionsEntity) Props(cns ...string) ([]interface{}, error)
type GroupPermissionsFindExpr ¶ added in v0.9.7
type GroupPermissionsIterator ¶
type GroupPermissionsIterator struct {
// contains filtered or unexported fields
}
GroupPermissionsIterator is not thread safe.
func (*GroupPermissionsIterator) Close ¶
func (i *GroupPermissionsIterator) Close() error
func (*GroupPermissionsIterator) Columns ¶
func (i *GroupPermissionsIterator) Columns() ([]string, error)
Columns is wrapper around sql.Rows.Columns method, that also cache output inside iterator.
func (*GroupPermissionsIterator) Ent ¶
func (i *GroupPermissionsIterator) Ent() (interface{}, error)
Ent is wrapper around GroupPermissions method that makes iterator more generic.
func (*GroupPermissionsIterator) Err ¶
func (i *GroupPermissionsIterator) Err() error
func (*GroupPermissionsIterator) GroupPermissions ¶
func (i *GroupPermissionsIterator) GroupPermissions() (*GroupPermissionsEntity, error)
func (*GroupPermissionsIterator) Next ¶
func (i *GroupPermissionsIterator) Next() bool
type GroupPermissionsJoin ¶ added in v0.9.7
type GroupPermissionsPatch ¶
type GroupPermissionsProvider ¶
type GroupPermissionsProvider interface {
Insert(context.Context, *GroupPermissionsEntity) (*GroupPermissionsEntity, error)
}
GroupPermissionsProvider ...
func NewGroupPermissionsRepository ¶
func NewGroupPermissionsRepository(dbPool *sql.DB) GroupPermissionsProvider
NewGroupPermissionsRepository ...
type GroupPermissionsRepository ¶
type GroupPermissionsRepository struct {
GroupPermissionsRepositoryBase
}
GroupPermissionsRepository extends GroupPermissionsRepositoryBase
type GroupPermissionsRepositoryBase ¶
func (*GroupPermissionsRepositoryBase) BeginTx ¶ added in v0.18.0
func (r *GroupPermissionsRepositoryBase) BeginTx(ctx context.Context) (*GroupPermissionsRepositoryBaseTx, error)
func (*GroupPermissionsRepositoryBase) Count ¶
func (r *GroupPermissionsRepositoryBase) Count(ctx context.Context, exp *GroupPermissionsCountExpr) (int64, error)
func (*GroupPermissionsRepositoryBase) Find ¶
func (r *GroupPermissionsRepositoryBase) Find(ctx context.Context, fe *GroupPermissionsFindExpr) ([]*GroupPermissionsEntity, error)
func (*GroupPermissionsRepositoryBase) FindIter ¶
func (r *GroupPermissionsRepositoryBase) FindIter(ctx context.Context, fe *GroupPermissionsFindExpr) (*GroupPermissionsIterator, error)
func (*GroupPermissionsRepositoryBase) FindOneByGroupIDAndPermissionSubsystemAndPermissionModuleAndPermissionAction ¶
func (r *GroupPermissionsRepositoryBase) FindOneByGroupIDAndPermissionSubsystemAndPermissionModuleAndPermissionAction(ctx context.Context, groupPermissionsGroupID int64, groupPermissionsPermissionSubsystem string, groupPermissionsPermissionModule string, groupPermissionsPermissionAction string) (*GroupPermissionsEntity, error)
func (*GroupPermissionsRepositoryBase) FindQuery ¶ added in v0.9.0
func (r *GroupPermissionsRepositoryBase) FindQuery(fe *GroupPermissionsFindExpr) (string, []interface{}, error)
func (*GroupPermissionsRepositoryBase) Insert ¶
func (r *GroupPermissionsRepositoryBase) Insert(ctx context.Context, e *GroupPermissionsEntity) (*GroupPermissionsEntity, error)
func (*GroupPermissionsRepositoryBase) InsertQuery ¶ added in v0.9.0
func (r *GroupPermissionsRepositoryBase) InsertQuery(e *GroupPermissionsEntity, read bool) (string, []interface{}, error)
func (GroupPermissionsRepositoryBase) RunInTransaction ¶ added in v0.18.0
func (r GroupPermissionsRepositoryBase) RunInTransaction(ctx context.Context, fn func(rtx *GroupPermissionsRepositoryBaseTx) error, attempts int) (err error)
func (*GroupPermissionsRepositoryBase) Tx ¶ added in v0.18.0
func (r *GroupPermissionsRepositoryBase) Tx(tx *sql.Tx) (*GroupPermissionsRepositoryBaseTx, error)
func (*GroupPermissionsRepositoryBase) UpdateOneByGroupIDAndPermissionSubsystemAndPermissionModuleAndPermissionAction ¶
func (r *GroupPermissionsRepositoryBase) UpdateOneByGroupIDAndPermissionSubsystemAndPermissionModuleAndPermissionAction(ctx context.Context, groupPermissionsGroupID int64, groupPermissionsPermissionSubsystem string, groupPermissionsPermissionModule string, groupPermissionsPermissionAction string, p *GroupPermissionsPatch) (*GroupPermissionsEntity, error)
func (*GroupPermissionsRepositoryBase) UpdateOneByGroupIDAndPermissionSubsystemAndPermissionModuleAndPermissionActionQuery ¶ added in v0.9.0
func (r *GroupPermissionsRepositoryBase) UpdateOneByGroupIDAndPermissionSubsystemAndPermissionModuleAndPermissionActionQuery(groupPermissionsGroupID int64, groupPermissionsPermissionSubsystem string, groupPermissionsPermissionModule string, groupPermissionsPermissionAction string, p *GroupPermissionsPatch) (string, []interface{}, error)
func (*GroupPermissionsRepositoryBase) Upsert ¶
func (r *GroupPermissionsRepositoryBase) Upsert(ctx context.Context, e *GroupPermissionsEntity, p *GroupPermissionsPatch, inf ...string) (*GroupPermissionsEntity, error)
func (*GroupPermissionsRepositoryBase) UpsertQuery ¶ added in v0.9.0
func (r *GroupPermissionsRepositoryBase) UpsertQuery(e *GroupPermissionsEntity, p *GroupPermissionsPatch, inf ...string) (string, []interface{}, error)
type GroupPermissionsRepositoryBaseTx ¶ added in v0.18.0
type GroupPermissionsRepositoryBaseTx struct {
// contains filtered or unexported fields
}
func (GroupPermissionsRepositoryBaseTx) Commit ¶ added in v0.18.0
func (r GroupPermissionsRepositoryBaseTx) Commit() error
func (*GroupPermissionsRepositoryBaseTx) Count ¶ added in v0.18.0
func (r *GroupPermissionsRepositoryBaseTx) Count(ctx context.Context, exp *GroupPermissionsCountExpr) (int64, error)
func (*GroupPermissionsRepositoryBaseTx) Find ¶ added in v0.18.0
func (r *GroupPermissionsRepositoryBaseTx) Find(ctx context.Context, fe *GroupPermissionsFindExpr) ([]*GroupPermissionsEntity, error)
func (*GroupPermissionsRepositoryBaseTx) FindIter ¶ added in v0.18.0
func (r *GroupPermissionsRepositoryBaseTx) FindIter(ctx context.Context, fe *GroupPermissionsFindExpr) (*GroupPermissionsIterator, error)
func (*GroupPermissionsRepositoryBaseTx) Insert ¶ added in v0.18.0
func (r *GroupPermissionsRepositoryBaseTx) Insert(ctx context.Context, e *GroupPermissionsEntity) (*GroupPermissionsEntity, error)
func (GroupPermissionsRepositoryBaseTx) Rollback ¶ added in v0.18.0
func (r GroupPermissionsRepositoryBaseTx) Rollback() error
func (*GroupPermissionsRepositoryBaseTx) UpdateOneByGroupIDAndPermissionSubsystemAndPermissionModuleAndPermissionAction ¶ added in v0.18.0
func (r *GroupPermissionsRepositoryBaseTx) UpdateOneByGroupIDAndPermissionSubsystemAndPermissionModuleAndPermissionAction(ctx context.Context, groupPermissionsGroupID int64, groupPermissionsPermissionSubsystem string, groupPermissionsPermissionModule string, groupPermissionsPermissionAction string, p *GroupPermissionsPatch) (*GroupPermissionsEntity, error)
func (*GroupPermissionsRepositoryBaseTx) Upsert ¶ added in v0.18.0
func (r *GroupPermissionsRepositoryBaseTx) Upsert(ctx context.Context, e *GroupPermissionsEntity, p *GroupPermissionsPatch, inf ...string) (*GroupPermissionsEntity, error)
type GroupProvider ¶
type GroupProvider interface { Insert(context.Context, *GroupEntity) (*GroupEntity, error) // FindByUserID retrieves all groups for user represented by given id. FindByUserID(context.Context, int64) ([]*GroupEntity, error) // FindOneByID retrieves group for given id. FindOneByID(context.Context, int64) (*GroupEntity, error) // find ... Find(context.Context, *GroupFindExpr) ([]*GroupEntity, error) // Create ... Create(ctx context.Context, createdBy int64, name string, description *ntypes.String) (*GroupEntity, error) // updateOneByID ... UpdateOneByID(context.Context, int64, *GroupPatch) (*GroupEntity, error) // DeleteByID ... DeleteOneByID(context.Context, int64) (int64, error) // IsGranted ... IsGranted(context.Context, int64, charon.Permission) (bool, error) // SetPermissions ... SetPermissions(context.Context, int64, ...charon.Permission) (int64, int64, error) }
GroupProvider ...
func NewGroupRepository ¶
func NewGroupRepository(dbPool *sql.DB) GroupProvider
NewGroupRepository ...
type GroupRepository ¶
type GroupRepository struct { GroupRepositoryBase UserGroups UserGroupsRepositoryBase }
GroupRepository extends GroupRepositoryBase
func (*GroupRepository) Create ¶
func (gr *GroupRepository) Create(ctx context.Context, createdBy int64, name string, description *ntypes.String) (ent *GroupEntity, err error)
Create ...
func (*GroupRepository) FindByUserID ¶
func (gr *GroupRepository) FindByUserID(ctx context.Context, userID int64) ([]*GroupEntity, error)
FindByUserID implements GroupProvider interface.
func (*GroupRepository) IsGranted ¶
func (gr *GroupRepository) IsGranted(ctx context.Context, id int64, p charon.Permission) (bool, error)
IsGranted ...
func (*GroupRepository) SetPermissions ¶
func (gr *GroupRepository) SetPermissions(ctx context.Context, id int64, p ...charon.Permission) (int64, int64, error)
SetPermissions ...
type GroupRepositoryBase ¶
func (*GroupRepositoryBase) BeginTx ¶ added in v0.18.0
func (r *GroupRepositoryBase) BeginTx(ctx context.Context) (*GroupRepositoryBaseTx, error)
func (*GroupRepositoryBase) Count ¶
func (r *GroupRepositoryBase) Count(ctx context.Context, exp *GroupCountExpr) (int64, error)
func (*GroupRepositoryBase) DeleteOneByID ¶
func (*GroupRepositoryBase) Find ¶
func (r *GroupRepositoryBase) Find(ctx context.Context, fe *GroupFindExpr) ([]*GroupEntity, error)
func (*GroupRepositoryBase) FindIter ¶
func (r *GroupRepositoryBase) FindIter(ctx context.Context, fe *GroupFindExpr) (*GroupIterator, error)
func (*GroupRepositoryBase) FindOneByID ¶
func (r *GroupRepositoryBase) FindOneByID(ctx context.Context, pk int64) (*GroupEntity, error)
func (*GroupRepositoryBase) FindOneByIDAndUpdate ¶ added in v0.18.0
func (r *GroupRepositoryBase) FindOneByIDAndUpdate(ctx context.Context, pk int64, p *GroupPatch) (before, after *GroupEntity, err error)
func (*GroupRepositoryBase) FindOneByName ¶
func (r *GroupRepositoryBase) FindOneByName(ctx context.Context, groupName string) (*GroupEntity, error)
func (*GroupRepositoryBase) FindQuery ¶ added in v0.9.0
func (r *GroupRepositoryBase) FindQuery(fe *GroupFindExpr) (string, []interface{}, error)
func (*GroupRepositoryBase) Insert ¶
func (r *GroupRepositoryBase) Insert(ctx context.Context, e *GroupEntity) (*GroupEntity, error)
func (*GroupRepositoryBase) InsertQuery ¶ added in v0.9.0
func (r *GroupRepositoryBase) InsertQuery(e *GroupEntity, read bool) (string, []interface{}, error)
func (GroupRepositoryBase) RunInTransaction ¶ added in v0.18.0
func (r GroupRepositoryBase) RunInTransaction(ctx context.Context, fn func(rtx *GroupRepositoryBaseTx) error, attempts int) (err error)
func (*GroupRepositoryBase) Tx ¶ added in v0.18.0
func (r *GroupRepositoryBase) Tx(tx *sql.Tx) (*GroupRepositoryBaseTx, error)
func (*GroupRepositoryBase) UpdateOneByID ¶
func (r *GroupRepositoryBase) UpdateOneByID(ctx context.Context, pk int64, p *GroupPatch) (*GroupEntity, error)
func (*GroupRepositoryBase) UpdateOneByIDQuery ¶ added in v0.9.0
func (r *GroupRepositoryBase) UpdateOneByIDQuery(pk int64, p *GroupPatch) (string, []interface{}, error)
func (*GroupRepositoryBase) UpdateOneByName ¶
func (r *GroupRepositoryBase) UpdateOneByName(ctx context.Context, groupName string, p *GroupPatch) (*GroupEntity, error)
func (*GroupRepositoryBase) UpdateOneByNameQuery ¶ added in v0.9.0
func (r *GroupRepositoryBase) UpdateOneByNameQuery(groupName string, p *GroupPatch) (string, []interface{}, error)
func (*GroupRepositoryBase) Upsert ¶
func (r *GroupRepositoryBase) Upsert(ctx context.Context, e *GroupEntity, p *GroupPatch, inf ...string) (*GroupEntity, error)
func (*GroupRepositoryBase) UpsertQuery ¶ added in v0.9.0
func (r *GroupRepositoryBase) UpsertQuery(e *GroupEntity, p *GroupPatch, inf ...string) (string, []interface{}, error)
type GroupRepositoryBaseTx ¶ added in v0.18.0
type GroupRepositoryBaseTx struct {
// contains filtered or unexported fields
}
func (GroupRepositoryBaseTx) Commit ¶ added in v0.18.0
func (r GroupRepositoryBaseTx) Commit() error
func (*GroupRepositoryBaseTx) Count ¶ added in v0.18.0
func (r *GroupRepositoryBaseTx) Count(ctx context.Context, exp *GroupCountExpr) (int64, error)
func (*GroupRepositoryBaseTx) DeleteOneByID ¶ added in v0.18.0
func (*GroupRepositoryBaseTx) Find ¶ added in v0.18.0
func (r *GroupRepositoryBaseTx) Find(ctx context.Context, fe *GroupFindExpr) ([]*GroupEntity, error)
func (*GroupRepositoryBaseTx) FindIter ¶ added in v0.18.0
func (r *GroupRepositoryBaseTx) FindIter(ctx context.Context, fe *GroupFindExpr) (*GroupIterator, error)
func (*GroupRepositoryBaseTx) FindOneByID ¶ added in v0.18.0
func (r *GroupRepositoryBaseTx) FindOneByID(ctx context.Context, pk int64) (*GroupEntity, error)
func (*GroupRepositoryBaseTx) Insert ¶ added in v0.18.0
func (r *GroupRepositoryBaseTx) Insert(ctx context.Context, e *GroupEntity) (*GroupEntity, error)
func (GroupRepositoryBaseTx) Rollback ¶ added in v0.18.0
func (r GroupRepositoryBaseTx) Rollback() error
func (*GroupRepositoryBaseTx) UpdateOneByID ¶ added in v0.18.0
func (r *GroupRepositoryBaseTx) UpdateOneByID(ctx context.Context, pk int64, p *GroupPatch) (*GroupEntity, error)
func (*GroupRepositoryBaseTx) UpdateOneByName ¶ added in v0.18.0
func (r *GroupRepositoryBaseTx) UpdateOneByName(ctx context.Context, groupName string, p *GroupPatch) (*GroupEntity, error)
func (*GroupRepositoryBaseTx) Upsert ¶ added in v0.18.0
func (r *GroupRepositoryBaseTx) Upsert(ctx context.Context, e *GroupEntity, p *GroupPatch, inf ...string) (*GroupEntity, error)
type JSONArrayFloat64 ¶ added in v0.9.0
type JSONArrayFloat64 []float64
JSONArrayFloat64 is a slice of int64s that implements necessary interfaces.
func (*JSONArrayFloat64) Scan ¶ added in v0.9.0
func (a *JSONArrayFloat64) Scan(src interface{}) error
Scan satisfy sql.Scanner interface.
type JSONArrayInt64 ¶ added in v0.9.0
type JSONArrayInt64 []int64
JSONArrayInt64 is a slice of int64s that implements necessary interfaces.
func (*JSONArrayInt64) Scan ¶ added in v0.9.0
func (a *JSONArrayInt64) Scan(src interface{}) error
Scan satisfy sql.Scanner interface.
type JSONArrayString ¶ added in v0.9.0
type JSONArrayString []string
JSONArrayString is a slice of strings that implements necessary interfaces.
func (*JSONArrayString) Scan ¶ added in v0.9.0
func (a *JSONArrayString) Scan(src interface{}) error
Scan satisfy sql.Scanner interface.
type JoinType ¶ added in v0.9.7
type JoinType int
func (JoinType) Actionable ¶ added in v0.18.0
Actionable returns true if JoinType is one of the known type except JoinDoNot.
type LogFunc ¶ added in v0.10.0
LogFunc represents function that can be passed into repository to log query result.
type NullBoolArray ¶ added in v0.9.0
func (*NullBoolArray) Scan ¶ added in v0.9.0
func (n *NullBoolArray) Scan(value interface{}) error
type NullByteaArray ¶ added in v0.9.0
type NullByteaArray struct { pq.ByteaArray Valid bool }
func (*NullByteaArray) Scan ¶ added in v0.9.0
func (n *NullByteaArray) Scan(value interface{}) error
type NullFloat64Array ¶ added in v0.9.0
type NullFloat64Array struct { pq.Float64Array Valid bool }
func (*NullFloat64Array) Scan ¶ added in v0.9.0
func (n *NullFloat64Array) Scan(value interface{}) error
type NullInt64Array ¶ added in v0.9.0
type NullInt64Array struct { pq.Int64Array Valid bool }
func (*NullInt64Array) Scan ¶ added in v0.9.0
func (n *NullInt64Array) Scan(value interface{}) error
type NullStringArray ¶ added in v0.9.0
type NullStringArray struct { pq.StringArray Valid bool }
func (*NullStringArray) Scan ¶ added in v0.9.0
func (n *NullStringArray) Scan(value interface{}) error
type PermissionCountExpr ¶ added in v0.9.7
type PermissionCountExpr struct {
Where *PermissionCriteria
}
type PermissionCriteria ¶
type PermissionCriteria struct { Action *qtypes.String CreatedAt *qtypes.Timestamp ID *qtypes.Int64 Module *qtypes.String Subsystem *qtypes.String UpdatedAt *qtypes.Timestamp // contains filtered or unexported fields }
func PermissionAnd ¶ added in v0.18.0
func PermissionAnd(operands ...*PermissionCriteria) *PermissionCriteria
func PermissionOperand ¶ added in v0.18.0
func PermissionOperand(operator string, operands ...*PermissionCriteria) *PermissionCriteria
func PermissionOr ¶ added in v0.18.0
func PermissionOr(operands ...*PermissionCriteria) *PermissionCriteria
type PermissionEntity ¶
type PermissionEntity struct { // Action ... Action string // CreatedAt ... CreatedAt time.Time // ID ... ID int64 // Module ... Module string // Subsystem ... Subsystem string // UpdatedAt ... UpdatedAt pq.NullTime // Users ... Users []*UserEntity // Groups ... Groups []*GroupEntity }
PermissionEntity ...
func ScanPermissionRows ¶
func ScanPermissionRows(rows Rows) (entities []*PermissionEntity, err error)
ScanPermissionRows helps to scan rows straight to the slice of entities.
func (*PermissionEntity) Permission ¶
func (pe *PermissionEntity) Permission() charon.Permission
Permission returns charon.Permission value that is concatenated using entity properties like subsystem, module and action.
func (*PermissionEntity) Prop ¶
func (e *PermissionEntity) Prop(cn string) (interface{}, bool)
func (*PermissionEntity) Props ¶
func (e *PermissionEntity) Props(cns ...string) ([]interface{}, error)
type PermissionFindExpr ¶ added in v0.9.7
type PermissionFindExpr struct { Where *PermissionCriteria Offset, Limit int64 Columns []string OrderBy []RowOrder }
type PermissionIterator ¶
type PermissionIterator struct {
// contains filtered or unexported fields
}
PermissionIterator is not thread safe.
func (*PermissionIterator) Close ¶
func (i *PermissionIterator) Close() error
func (*PermissionIterator) Columns ¶
func (i *PermissionIterator) Columns() ([]string, error)
Columns is wrapper around sql.Rows.Columns method, that also cache output inside iterator.
func (*PermissionIterator) Ent ¶
func (i *PermissionIterator) Ent() (interface{}, error)
Ent is wrapper around Permission method that makes iterator more generic.
func (*PermissionIterator) Err ¶
func (i *PermissionIterator) Err() error
func (*PermissionIterator) Next ¶
func (i *PermissionIterator) Next() bool
func (*PermissionIterator) Permission ¶
func (i *PermissionIterator) Permission() (*PermissionEntity, error)
type PermissionJoin ¶ added in v0.9.7
type PermissionJoin struct {
On, Where *PermissionCriteria
Fetch bool
Kind JoinType
}
type PermissionPatch ¶
type PermissionProvider ¶
type PermissionProvider interface { Find(ctx context.Context, criteria *PermissionFindExpr) ([]*PermissionEntity, error) FindOneByID(ctx context.Context, id int64) (entity *PermissionEntity, err error) // FindByUserID retrieves all permissions for user represented by given id. FindByUserID(ctx context.Context, userID int64) (entities []*PermissionEntity, err error) // FindByGroupID retrieves all permissions for group represented by given id. FindByGroupID(ctx context.Context, groupID int64) (entities []*PermissionEntity, err error) Register(ctx context.Context, permissions charon.Permissions) (created, untouched, removed int64, err error) Insert(ctx context.Context, entity *PermissionEntity) (*PermissionEntity, error) InsertMissing(ctx context.Context, permissions charon.Permissions) (int64, error) }
PermissionProvider ...
type PermissionReg ¶
PermissionReg ...
func NewPermissionRegistry ¶
func NewPermissionRegistry(r PermissionProvider) *PermissionReg
NewPermissionRegistry ...
func (*PermissionReg) Exists ¶
func (pr *PermissionReg) Exists(_ context.Context, permission charon.Permission) (ok bool)
Exists ...
func (*PermissionReg) Register ¶
func (pr *PermissionReg) Register(ctx context.Context, permissions charon.Permissions) (created, untouched, removed int64, err error)
Register ...
type PermissionRegistry ¶
type PermissionRegistry interface { // Exists returns true if given charon.Permission was already registered. Exists(ctx context.Context, permission charon.Permission) (exists bool) // Register checks if given collection is valid and // calls PermissionProvider to store provided permissions // in persistent way. Register(ctx context.Context, permissions charon.Permissions) (created, untouched, removed int64, err error) }
PermissionRegistry is an interface that describes in memory storage that holds information about permissions that was registered by 3rd party services. Should be only used as a proxy for registration process to avoid multiple sql hits.
type PermissionRepository ¶
type PermissionRepository struct { PermissionRepositoryBase // contains filtered or unexported fields }
PermissionRepository extends PermissionRepositoryBase
func NewPermissionRepository ¶
func NewPermissionRepository(dbPool *sql.DB) *PermissionRepository
NewPermissionRepository ...
func (*PermissionRepository) FindBy ¶
func (pr *PermissionRepository) FindBy(ctx context.Context, query string, args ...interface{}) ([]*PermissionEntity, error)
FindBy ...
func (*PermissionRepository) FindByGroupID ¶
func (pr *PermissionRepository) FindByGroupID(ctx context.Context, groupID int64) ([]*PermissionEntity, error)
FindByGroupID implements PermissionProvider interface.
func (*PermissionRepository) FindByTag ¶
func (pr *PermissionRepository) FindByTag(ctx context.Context, userID int64) ([]*PermissionEntity, error)
FindByTag ...
func (*PermissionRepository) FindByUserID ¶
func (pr *PermissionRepository) FindByUserID(ctx context.Context, userID int64) ([]*PermissionEntity, error)
FindByUserID implements PermissionProvider interface.
func (*PermissionRepository) InsertMissing ¶ added in v0.15.0
func (pr *PermissionRepository) InsertMissing(ctx context.Context, permissions charon.Permissions) (int64, error)
func (*PermissionRepository) Register ¶
func (pr *PermissionRepository) Register(ctx context.Context, permissions charon.Permissions) (created, unt, removed int64, err error)
Register ...
type PermissionRepositoryBase ¶
func (*PermissionRepositoryBase) BeginTx ¶ added in v0.18.0
func (r *PermissionRepositoryBase) BeginTx(ctx context.Context) (*PermissionRepositoryBaseTx, error)
func (*PermissionRepositoryBase) Count ¶
func (r *PermissionRepositoryBase) Count(ctx context.Context, exp *PermissionCountExpr) (int64, error)
func (*PermissionRepositoryBase) DeleteOneByID ¶
func (*PermissionRepositoryBase) Find ¶
func (r *PermissionRepositoryBase) Find(ctx context.Context, fe *PermissionFindExpr) ([]*PermissionEntity, error)
func (*PermissionRepositoryBase) FindIter ¶
func (r *PermissionRepositoryBase) FindIter(ctx context.Context, fe *PermissionFindExpr) (*PermissionIterator, error)
func (*PermissionRepositoryBase) FindOneByID ¶
func (r *PermissionRepositoryBase) FindOneByID(ctx context.Context, pk int64) (*PermissionEntity, error)
func (*PermissionRepositoryBase) FindOneByIDAndUpdate ¶ added in v0.18.0
func (r *PermissionRepositoryBase) FindOneByIDAndUpdate(ctx context.Context, pk int64, p *PermissionPatch) (before, after *PermissionEntity, err error)
func (*PermissionRepositoryBase) FindOneBySubsystemAndModuleAndAction ¶
func (r *PermissionRepositoryBase) FindOneBySubsystemAndModuleAndAction(ctx context.Context, permissionSubsystem string, permissionModule string, permissionAction string) (*PermissionEntity, error)
func (*PermissionRepositoryBase) FindQuery ¶ added in v0.9.0
func (r *PermissionRepositoryBase) FindQuery(fe *PermissionFindExpr) (string, []interface{}, error)
func (*PermissionRepositoryBase) Insert ¶
func (r *PermissionRepositoryBase) Insert(ctx context.Context, e *PermissionEntity) (*PermissionEntity, error)
func (*PermissionRepositoryBase) InsertQuery ¶ added in v0.9.0
func (r *PermissionRepositoryBase) InsertQuery(e *PermissionEntity, read bool) (string, []interface{}, error)
func (PermissionRepositoryBase) RunInTransaction ¶ added in v0.18.0
func (r PermissionRepositoryBase) RunInTransaction(ctx context.Context, fn func(rtx *PermissionRepositoryBaseTx) error, attempts int) (err error)
func (*PermissionRepositoryBase) Tx ¶ added in v0.18.0
func (r *PermissionRepositoryBase) Tx(tx *sql.Tx) (*PermissionRepositoryBaseTx, error)
func (*PermissionRepositoryBase) UpdateOneByID ¶
func (r *PermissionRepositoryBase) UpdateOneByID(ctx context.Context, pk int64, p *PermissionPatch) (*PermissionEntity, error)
func (*PermissionRepositoryBase) UpdateOneByIDQuery ¶ added in v0.9.0
func (r *PermissionRepositoryBase) UpdateOneByIDQuery(pk int64, p *PermissionPatch) (string, []interface{}, error)
func (*PermissionRepositoryBase) UpdateOneBySubsystemAndModuleAndAction ¶
func (r *PermissionRepositoryBase) UpdateOneBySubsystemAndModuleAndAction(ctx context.Context, permissionSubsystem string, permissionModule string, permissionAction string, p *PermissionPatch) (*PermissionEntity, error)
func (*PermissionRepositoryBase) UpdateOneBySubsystemAndModuleAndActionQuery ¶ added in v0.9.0
func (r *PermissionRepositoryBase) UpdateOneBySubsystemAndModuleAndActionQuery(permissionSubsystem string, permissionModule string, permissionAction string, p *PermissionPatch) (string, []interface{}, error)
func (*PermissionRepositoryBase) Upsert ¶
func (r *PermissionRepositoryBase) Upsert(ctx context.Context, e *PermissionEntity, p *PermissionPatch, inf ...string) (*PermissionEntity, error)
func (*PermissionRepositoryBase) UpsertQuery ¶ added in v0.9.0
func (r *PermissionRepositoryBase) UpsertQuery(e *PermissionEntity, p *PermissionPatch, inf ...string) (string, []interface{}, error)
type PermissionRepositoryBaseTx ¶ added in v0.18.0
type PermissionRepositoryBaseTx struct {
// contains filtered or unexported fields
}
func (PermissionRepositoryBaseTx) Commit ¶ added in v0.18.0
func (r PermissionRepositoryBaseTx) Commit() error
func (*PermissionRepositoryBaseTx) Count ¶ added in v0.18.0
func (r *PermissionRepositoryBaseTx) Count(ctx context.Context, exp *PermissionCountExpr) (int64, error)
func (*PermissionRepositoryBaseTx) DeleteOneByID ¶ added in v0.18.0
func (*PermissionRepositoryBaseTx) Find ¶ added in v0.18.0
func (r *PermissionRepositoryBaseTx) Find(ctx context.Context, fe *PermissionFindExpr) ([]*PermissionEntity, error)
func (*PermissionRepositoryBaseTx) FindIter ¶ added in v0.18.0
func (r *PermissionRepositoryBaseTx) FindIter(ctx context.Context, fe *PermissionFindExpr) (*PermissionIterator, error)
func (*PermissionRepositoryBaseTx) FindOneByID ¶ added in v0.18.0
func (r *PermissionRepositoryBaseTx) FindOneByID(ctx context.Context, pk int64) (*PermissionEntity, error)
func (*PermissionRepositoryBaseTx) Insert ¶ added in v0.18.0
func (r *PermissionRepositoryBaseTx) Insert(ctx context.Context, e *PermissionEntity) (*PermissionEntity, error)
func (PermissionRepositoryBaseTx) Rollback ¶ added in v0.18.0
func (r PermissionRepositoryBaseTx) Rollback() error
func (*PermissionRepositoryBaseTx) UpdateOneByID ¶ added in v0.18.0
func (r *PermissionRepositoryBaseTx) UpdateOneByID(ctx context.Context, pk int64, p *PermissionPatch) (*PermissionEntity, error)
func (*PermissionRepositoryBaseTx) UpdateOneBySubsystemAndModuleAndAction ¶ added in v0.18.0
func (r *PermissionRepositoryBaseTx) UpdateOneBySubsystemAndModuleAndAction(ctx context.Context, permissionSubsystem string, permissionModule string, permissionAction string, p *PermissionPatch) (*PermissionEntity, error)
func (*PermissionRepositoryBaseTx) Upsert ¶ added in v0.18.0
func (r *PermissionRepositoryBaseTx) Upsert(ctx context.Context, e *PermissionEntity, p *PermissionPatch, inf ...string) (*PermissionEntity, error)
type RefreshTokenCountExpr ¶ added in v0.18.0
type RefreshTokenCountExpr struct { Where *RefreshTokenCriteria JoinUser *UserJoin JoinAuthor *UserJoin JoinModifier *UserJoin }
type RefreshTokenCriteria ¶ added in v0.18.0
type RefreshTokenCriteria struct { CreatedAt *qtypes.Timestamp CreatedBy *qtypes.Int64 ExpireAt *qtypes.Timestamp LastUsedAt *qtypes.Timestamp Notes *qtypes.String Revoked ntypes.Bool Token *qtypes.String UpdatedAt *qtypes.Timestamp UpdatedBy *qtypes.Int64 UserID *qtypes.Int64 // contains filtered or unexported fields }
func RefreshTokenAnd ¶ added in v0.18.0
func RefreshTokenAnd(operands ...*RefreshTokenCriteria) *RefreshTokenCriteria
func RefreshTokenOperand ¶ added in v0.18.0
func RefreshTokenOperand(operator string, operands ...*RefreshTokenCriteria) *RefreshTokenCriteria
func RefreshTokenOr ¶ added in v0.18.0
func RefreshTokenOr(operands ...*RefreshTokenCriteria) *RefreshTokenCriteria
type RefreshTokenEntity ¶ added in v0.18.0
type RefreshTokenEntity struct { // CreatedAt ... CreatedAt time.Time // CreatedBy ... CreatedBy ntypes.Int64 // ExpireAt ... ExpireAt pq.NullTime // LastUsedAt ... LastUsedAt pq.NullTime // Notes ... Notes ntypes.String // Revoked ... Revoked bool // Token ... Token string // UpdatedAt ... UpdatedAt pq.NullTime // UpdatedBy ... UpdatedBy ntypes.Int64 // UserID ... UserID int64 // User ... User *UserEntity // Author ... Author *UserEntity // Modifier ... Modifier *UserEntity }
RefreshTokenEntity ...
func ScanRefreshTokenRows ¶ added in v0.18.0
func ScanRefreshTokenRows(rows Rows) (entities []*RefreshTokenEntity, err error)
ScanRefreshTokenRows helps to scan rows straight to the slice of entities.
func (*RefreshTokenEntity) Prop ¶ added in v0.18.0
func (e *RefreshTokenEntity) Prop(cn string) (interface{}, bool)
func (*RefreshTokenEntity) Props ¶ added in v0.18.0
func (e *RefreshTokenEntity) Props(cns ...string) ([]interface{}, error)
type RefreshTokenFindExpr ¶ added in v0.18.0
type RefreshTokenIterator ¶ added in v0.18.0
type RefreshTokenIterator struct {
// contains filtered or unexported fields
}
RefreshTokenIterator is not thread safe.
func (*RefreshTokenIterator) Close ¶ added in v0.18.0
func (i *RefreshTokenIterator) Close() error
func (*RefreshTokenIterator) Columns ¶ added in v0.18.0
func (i *RefreshTokenIterator) Columns() ([]string, error)
Columns is wrapper around sql.Rows.Columns method, that also cache output inside iterator.
func (*RefreshTokenIterator) Ent ¶ added in v0.18.0
func (i *RefreshTokenIterator) Ent() (interface{}, error)
Ent is wrapper around RefreshToken method that makes iterator more generic.
func (*RefreshTokenIterator) Err ¶ added in v0.18.0
func (i *RefreshTokenIterator) Err() error
func (*RefreshTokenIterator) Next ¶ added in v0.18.0
func (i *RefreshTokenIterator) Next() bool
func (*RefreshTokenIterator) RefreshToken ¶ added in v0.18.0
func (i *RefreshTokenIterator) RefreshToken() (*RefreshTokenEntity, error)
type RefreshTokenJoin ¶ added in v0.18.0
type RefreshTokenPatch ¶ added in v0.18.0
type RefreshTokenProvider ¶ added in v0.18.0
type RefreshTokenProvider interface { // Find ... Find(context.Context, *RefreshTokenFindExpr) ([]*RefreshTokenEntity, error) // FindOneByToken ... FindOneByToken(context.Context, string) (*RefreshTokenEntity, error) // Create ... Create(context.Context, *RefreshTokenEntity) (*RefreshTokenEntity, error) // UpdateOneByToken ... UpdateOneByToken(context.Context, string, *RefreshTokenPatch) (*RefreshTokenEntity, error) // FindOneByTokenAndUserID . FindOneByTokenAndUserID(ctx context.Context, token string, userID int64) (*RefreshTokenEntity, error) }
RefreshTokenProvider ...
func NewRefreshTokenRepository ¶ added in v0.18.0
func NewRefreshTokenRepository(dbPool *sql.DB) RefreshTokenProvider
NewRefreshTokenRepository ...
type RefreshTokenRepository ¶ added in v0.18.0
type RefreshTokenRepository struct {
RefreshTokenRepositoryBase
}
RefreshTokenRepository extends RefreshTokenRepositoryBase
func (*RefreshTokenRepository) Create ¶ added in v0.18.0
func (rtr *RefreshTokenRepository) Create(ctx context.Context, ent *RefreshTokenEntity) (*RefreshTokenEntity, error)
Create ...
func (*RefreshTokenRepository) FindOneByTokenAndUserID ¶ added in v0.18.0
func (rtr *RefreshTokenRepository) FindOneByTokenAndUserID(ctx context.Context, token string, userID int64) (*RefreshTokenEntity, error)
FindOneByTokenAndUserID ...
type RefreshTokenRepositoryBase ¶ added in v0.18.0
func (*RefreshTokenRepositoryBase) BeginTx ¶ added in v0.18.0
func (r *RefreshTokenRepositoryBase) BeginTx(ctx context.Context) (*RefreshTokenRepositoryBaseTx, error)
func (*RefreshTokenRepositoryBase) Count ¶ added in v0.18.0
func (r *RefreshTokenRepositoryBase) Count(ctx context.Context, exp *RefreshTokenCountExpr) (int64, error)
func (*RefreshTokenRepositoryBase) Find ¶ added in v0.18.0
func (r *RefreshTokenRepositoryBase) Find(ctx context.Context, fe *RefreshTokenFindExpr) ([]*RefreshTokenEntity, error)
func (*RefreshTokenRepositoryBase) FindIter ¶ added in v0.18.0
func (r *RefreshTokenRepositoryBase) FindIter(ctx context.Context, fe *RefreshTokenFindExpr) (*RefreshTokenIterator, error)
func (*RefreshTokenRepositoryBase) FindOneByToken ¶ added in v0.18.0
func (r *RefreshTokenRepositoryBase) FindOneByToken(ctx context.Context, refreshTokenToken string) (*RefreshTokenEntity, error)
func (*RefreshTokenRepositoryBase) FindQuery ¶ added in v0.18.0
func (r *RefreshTokenRepositoryBase) FindQuery(fe *RefreshTokenFindExpr) (string, []interface{}, error)
func (*RefreshTokenRepositoryBase) Insert ¶ added in v0.18.0
func (r *RefreshTokenRepositoryBase) Insert(ctx context.Context, e *RefreshTokenEntity) (*RefreshTokenEntity, error)
func (*RefreshTokenRepositoryBase) InsertQuery ¶ added in v0.18.0
func (r *RefreshTokenRepositoryBase) InsertQuery(e *RefreshTokenEntity, read bool) (string, []interface{}, error)
func (RefreshTokenRepositoryBase) RunInTransaction ¶ added in v0.18.0
func (r RefreshTokenRepositoryBase) RunInTransaction(ctx context.Context, fn func(rtx *RefreshTokenRepositoryBaseTx) error, attempts int) (err error)
func (*RefreshTokenRepositoryBase) Tx ¶ added in v0.18.0
func (r *RefreshTokenRepositoryBase) Tx(tx *sql.Tx) (*RefreshTokenRepositoryBaseTx, error)
func (*RefreshTokenRepositoryBase) UpdateOneByToken ¶ added in v0.18.0
func (r *RefreshTokenRepositoryBase) UpdateOneByToken(ctx context.Context, refreshTokenToken string, p *RefreshTokenPatch) (*RefreshTokenEntity, error)
func (*RefreshTokenRepositoryBase) UpdateOneByTokenQuery ¶ added in v0.18.0
func (r *RefreshTokenRepositoryBase) UpdateOneByTokenQuery(refreshTokenToken string, p *RefreshTokenPatch) (string, []interface{}, error)
func (*RefreshTokenRepositoryBase) Upsert ¶ added in v0.18.0
func (r *RefreshTokenRepositoryBase) Upsert(ctx context.Context, e *RefreshTokenEntity, p *RefreshTokenPatch, inf ...string) (*RefreshTokenEntity, error)
func (*RefreshTokenRepositoryBase) UpsertQuery ¶ added in v0.18.0
func (r *RefreshTokenRepositoryBase) UpsertQuery(e *RefreshTokenEntity, p *RefreshTokenPatch, inf ...string) (string, []interface{}, error)
type RefreshTokenRepositoryBaseTx ¶ added in v0.18.0
type RefreshTokenRepositoryBaseTx struct {
// contains filtered or unexported fields
}
func (RefreshTokenRepositoryBaseTx) Commit ¶ added in v0.18.0
func (r RefreshTokenRepositoryBaseTx) Commit() error
func (*RefreshTokenRepositoryBaseTx) Count ¶ added in v0.18.0
func (r *RefreshTokenRepositoryBaseTx) Count(ctx context.Context, exp *RefreshTokenCountExpr) (int64, error)
func (*RefreshTokenRepositoryBaseTx) Find ¶ added in v0.18.0
func (r *RefreshTokenRepositoryBaseTx) Find(ctx context.Context, fe *RefreshTokenFindExpr) ([]*RefreshTokenEntity, error)
func (*RefreshTokenRepositoryBaseTx) FindIter ¶ added in v0.18.0
func (r *RefreshTokenRepositoryBaseTx) FindIter(ctx context.Context, fe *RefreshTokenFindExpr) (*RefreshTokenIterator, error)
func (*RefreshTokenRepositoryBaseTx) Insert ¶ added in v0.18.0
func (r *RefreshTokenRepositoryBaseTx) Insert(ctx context.Context, e *RefreshTokenEntity) (*RefreshTokenEntity, error)
func (RefreshTokenRepositoryBaseTx) Rollback ¶ added in v0.18.0
func (r RefreshTokenRepositoryBaseTx) Rollback() error
func (*RefreshTokenRepositoryBaseTx) UpdateOneByToken ¶ added in v0.18.0
func (r *RefreshTokenRepositoryBaseTx) UpdateOneByToken(ctx context.Context, refreshTokenToken string, p *RefreshTokenPatch) (*RefreshTokenEntity, error)
func (*RefreshTokenRepositoryBaseTx) Upsert ¶ added in v0.18.0
func (r *RefreshTokenRepositoryBaseTx) Upsert(ctx context.Context, e *RefreshTokenEntity, p *RefreshTokenPatch, inf ...string) (*RefreshTokenEntity, error)
type Rows ¶ added in v0.10.0
type Rows interface { io.Closer ColumnTypes() ([]*sql.ColumnType, error) Columns() ([]string, error) Err() error Next() bool NextResultSet() bool Scan(dst ...interface{}) error }
Rows ...
type UserCountExpr ¶ added in v0.9.7
type UserCountExpr struct { Where *UserCriteria JoinAuthor *UserJoin JoinModifier *UserJoin }
type UserCriteria ¶
type UserCriteria struct { ConfirmationToken []byte CreatedAt *qtypes.Timestamp CreatedBy *qtypes.Int64 FirstName *qtypes.String ID *qtypes.Int64 IsActive ntypes.Bool IsConfirmed ntypes.Bool IsStaff ntypes.Bool IsSuperuser ntypes.Bool LastLoginAt *qtypes.Timestamp LastName *qtypes.String Password []byte UpdatedAt *qtypes.Timestamp UpdatedBy *qtypes.Int64 Username *qtypes.String // contains filtered or unexported fields }
func UserAnd ¶ added in v0.18.0
func UserAnd(operands ...*UserCriteria) *UserCriteria
func UserOperand ¶ added in v0.18.0
func UserOperand(operator string, operands ...*UserCriteria) *UserCriteria
func UserOr ¶ added in v0.18.0
func UserOr(operands ...*UserCriteria) *UserCriteria
type UserEntity ¶
type UserEntity struct { // ConfirmationToken ... ConfirmationToken []byte // CreatedAt ... CreatedAt time.Time // CreatedBy ... CreatedBy ntypes.Int64 // FirstName ... FirstName string // ID ... ID int64 // IsActive ... IsActive bool // IsConfirmed ... IsConfirmed bool // IsStaff ... IsStaff bool // IsSuperuser ... IsSuperuser bool // LastLoginAt ... LastLoginAt pq.NullTime // LastName ... LastName string // Password ... Password []byte // UpdatedAt ... UpdatedAt pq.NullTime // UpdatedBy ... UpdatedBy ntypes.Int64 // Username ... Username string // Author ... Author *UserEntity // Modifier ... Modifier *UserEntity // Permissions ... Permissions []*PermissionEntity // Groups ... Groups []*GroupEntity }
UserEntity ...
func ScanUserRows ¶
func ScanUserRows(rows Rows) (entities []*UserEntity, err error)
ScanUserRows helps to scan rows straight to the slice of entities.
func (*UserEntity) Prop ¶
func (e *UserEntity) Prop(cn string) (interface{}, bool)
func (*UserEntity) Props ¶
func (e *UserEntity) Props(cns ...string) ([]interface{}, error)
func (*UserEntity) String ¶
func (ue *UserEntity) String() string
String return concatenated first and last name of the user. Implements fmt Stringer interface.
type UserFindExpr ¶ added in v0.9.7
type UserGroupsCountExpr ¶ added in v0.9.7
type UserGroupsCountExpr struct { Where *UserGroupsCriteria JoinUser *UserJoin JoinGroup *GroupJoin JoinAuthor *UserJoin JoinModifier *UserJoin }
type UserGroupsCriteria ¶
type UserGroupsCriteria struct { CreatedAt *qtypes.Timestamp CreatedBy *qtypes.Int64 GroupID *qtypes.Int64 UpdatedAt *qtypes.Timestamp UpdatedBy *qtypes.Int64 UserID *qtypes.Int64 // contains filtered or unexported fields }
func UserGroupsAnd ¶ added in v0.18.0
func UserGroupsAnd(operands ...*UserGroupsCriteria) *UserGroupsCriteria
func UserGroupsOperand ¶ added in v0.18.0
func UserGroupsOperand(operator string, operands ...*UserGroupsCriteria) *UserGroupsCriteria
func UserGroupsOr ¶ added in v0.18.0
func UserGroupsOr(operands ...*UserGroupsCriteria) *UserGroupsCriteria
type UserGroupsEntity ¶
type UserGroupsEntity struct { // CreatedAt ... CreatedAt time.Time // CreatedBy ... CreatedBy ntypes.Int64 // GroupID ... GroupID int64 // UpdatedAt ... UpdatedAt pq.NullTime // UpdatedBy ... UpdatedBy ntypes.Int64 // UserID ... UserID int64 // User ... User *UserEntity // Group ... Group *GroupEntity // Author ... Author *UserEntity // Modifier ... Modifier *UserEntity }
UserGroupsEntity ...
func ScanUserGroupsRows ¶
func ScanUserGroupsRows(rows Rows) (entities []*UserGroupsEntity, err error)
ScanUserGroupsRows helps to scan rows straight to the slice of entities.
func (*UserGroupsEntity) Prop ¶
func (e *UserGroupsEntity) Prop(cn string) (interface{}, bool)
func (*UserGroupsEntity) Props ¶
func (e *UserGroupsEntity) Props(cns ...string) ([]interface{}, error)
type UserGroupsFindExpr ¶ added in v0.9.7
type UserGroupsIterator ¶
type UserGroupsIterator struct {
// contains filtered or unexported fields
}
UserGroupsIterator is not thread safe.
func (*UserGroupsIterator) Close ¶
func (i *UserGroupsIterator) Close() error
func (*UserGroupsIterator) Columns ¶
func (i *UserGroupsIterator) Columns() ([]string, error)
Columns is wrapper around sql.Rows.Columns method, that also cache output inside iterator.
func (*UserGroupsIterator) Ent ¶
func (i *UserGroupsIterator) Ent() (interface{}, error)
Ent is wrapper around UserGroups method that makes iterator more generic.
func (*UserGroupsIterator) Err ¶
func (i *UserGroupsIterator) Err() error
func (*UserGroupsIterator) Next ¶
func (i *UserGroupsIterator) Next() bool
func (*UserGroupsIterator) UserGroups ¶
func (i *UserGroupsIterator) UserGroups() (*UserGroupsEntity, error)
type UserGroupsJoin ¶ added in v0.9.7
type UserGroupsPatch ¶
type UserGroupsProvider ¶
type UserGroupsProvider interface { Insert(ctx context.Context, ent *UserGroupsEntity) (*UserGroupsEntity, error) Exists(ctx context.Context, userID, groupID int64) (bool, error) Find(ctx context.Context, expr *UserGroupsFindExpr) ([]*UserGroupsEntity, error) Set(ctx context.Context, userID int64, groupIDs []int64) (int64, int64, error) DeleteByUserID(ctx context.Context, id int64) (int64, error) }
UserGroupsProvider ...
func NewUserGroupsRepository ¶
func NewUserGroupsRepository(dbPool *sql.DB) UserGroupsProvider
NewUserGroupsRepository ...
type UserGroupsRepository ¶
type UserGroupsRepository struct { UserGroupsRepositoryBase // contains filtered or unexported fields }
UserGroupsRepository ...
func (*UserGroupsRepository) DeleteByUserID ¶ added in v0.8.4
DeleteByUserID removes user from all groups he belongs to.
type UserGroupsRepositoryBase ¶
func (*UserGroupsRepositoryBase) BeginTx ¶ added in v0.18.0
func (r *UserGroupsRepositoryBase) BeginTx(ctx context.Context) (*UserGroupsRepositoryBaseTx, error)
func (*UserGroupsRepositoryBase) Count ¶
func (r *UserGroupsRepositoryBase) Count(ctx context.Context, exp *UserGroupsCountExpr) (int64, error)
func (*UserGroupsRepositoryBase) Find ¶
func (r *UserGroupsRepositoryBase) Find(ctx context.Context, fe *UserGroupsFindExpr) ([]*UserGroupsEntity, error)
func (*UserGroupsRepositoryBase) FindIter ¶
func (r *UserGroupsRepositoryBase) FindIter(ctx context.Context, fe *UserGroupsFindExpr) (*UserGroupsIterator, error)
func (*UserGroupsRepositoryBase) FindOneByUserIDAndGroupID ¶
func (r *UserGroupsRepositoryBase) FindOneByUserIDAndGroupID(ctx context.Context, userGroupsUserID int64, userGroupsGroupID int64) (*UserGroupsEntity, error)
func (*UserGroupsRepositoryBase) FindQuery ¶ added in v0.9.0
func (r *UserGroupsRepositoryBase) FindQuery(fe *UserGroupsFindExpr) (string, []interface{}, error)
func (*UserGroupsRepositoryBase) Insert ¶
func (r *UserGroupsRepositoryBase) Insert(ctx context.Context, e *UserGroupsEntity) (*UserGroupsEntity, error)
func (*UserGroupsRepositoryBase) InsertQuery ¶ added in v0.9.0
func (r *UserGroupsRepositoryBase) InsertQuery(e *UserGroupsEntity, read bool) (string, []interface{}, error)
func (UserGroupsRepositoryBase) RunInTransaction ¶ added in v0.18.0
func (r UserGroupsRepositoryBase) RunInTransaction(ctx context.Context, fn func(rtx *UserGroupsRepositoryBaseTx) error, attempts int) (err error)
func (*UserGroupsRepositoryBase) Tx ¶ added in v0.18.0
func (r *UserGroupsRepositoryBase) Tx(tx *sql.Tx) (*UserGroupsRepositoryBaseTx, error)
func (*UserGroupsRepositoryBase) UpdateOneByUserIDAndGroupID ¶
func (r *UserGroupsRepositoryBase) UpdateOneByUserIDAndGroupID(ctx context.Context, userGroupsUserID int64, userGroupsGroupID int64, p *UserGroupsPatch) (*UserGroupsEntity, error)
func (*UserGroupsRepositoryBase) UpdateOneByUserIDAndGroupIDQuery ¶ added in v0.9.0
func (r *UserGroupsRepositoryBase) UpdateOneByUserIDAndGroupIDQuery(userGroupsUserID int64, userGroupsGroupID int64, p *UserGroupsPatch) (string, []interface{}, error)
func (*UserGroupsRepositoryBase) Upsert ¶
func (r *UserGroupsRepositoryBase) Upsert(ctx context.Context, e *UserGroupsEntity, p *UserGroupsPatch, inf ...string) (*UserGroupsEntity, error)
func (*UserGroupsRepositoryBase) UpsertQuery ¶ added in v0.9.0
func (r *UserGroupsRepositoryBase) UpsertQuery(e *UserGroupsEntity, p *UserGroupsPatch, inf ...string) (string, []interface{}, error)
type UserGroupsRepositoryBaseTx ¶ added in v0.18.0
type UserGroupsRepositoryBaseTx struct {
// contains filtered or unexported fields
}
func (UserGroupsRepositoryBaseTx) Commit ¶ added in v0.18.0
func (r UserGroupsRepositoryBaseTx) Commit() error
func (*UserGroupsRepositoryBaseTx) Count ¶ added in v0.18.0
func (r *UserGroupsRepositoryBaseTx) Count(ctx context.Context, exp *UserGroupsCountExpr) (int64, error)
func (*UserGroupsRepositoryBaseTx) Find ¶ added in v0.18.0
func (r *UserGroupsRepositoryBaseTx) Find(ctx context.Context, fe *UserGroupsFindExpr) ([]*UserGroupsEntity, error)
func (*UserGroupsRepositoryBaseTx) FindIter ¶ added in v0.18.0
func (r *UserGroupsRepositoryBaseTx) FindIter(ctx context.Context, fe *UserGroupsFindExpr) (*UserGroupsIterator, error)
func (*UserGroupsRepositoryBaseTx) Insert ¶ added in v0.18.0
func (r *UserGroupsRepositoryBaseTx) Insert(ctx context.Context, e *UserGroupsEntity) (*UserGroupsEntity, error)
func (UserGroupsRepositoryBaseTx) Rollback ¶ added in v0.18.0
func (r UserGroupsRepositoryBaseTx) Rollback() error
func (*UserGroupsRepositoryBaseTx) UpdateOneByUserIDAndGroupID ¶ added in v0.18.0
func (r *UserGroupsRepositoryBaseTx) UpdateOneByUserIDAndGroupID(ctx context.Context, userGroupsUserID int64, userGroupsGroupID int64, p *UserGroupsPatch) (*UserGroupsEntity, error)
func (*UserGroupsRepositoryBaseTx) Upsert ¶ added in v0.18.0
func (r *UserGroupsRepositoryBaseTx) Upsert(ctx context.Context, e *UserGroupsEntity, p *UserGroupsPatch, inf ...string) (*UserGroupsEntity, error)
type UserIterator ¶
type UserIterator struct {
// contains filtered or unexported fields
}
UserIterator is not thread safe.
func (*UserIterator) Close ¶
func (i *UserIterator) Close() error
func (*UserIterator) Columns ¶
func (i *UserIterator) Columns() ([]string, error)
Columns is wrapper around sql.Rows.Columns method, that also cache output inside iterator.
func (*UserIterator) Ent ¶
func (i *UserIterator) Ent() (interface{}, error)
Ent is wrapper around User method that makes iterator more generic.
func (*UserIterator) Err ¶
func (i *UserIterator) Err() error
func (*UserIterator) Next ¶
func (i *UserIterator) Next() bool
func (*UserIterator) User ¶
func (i *UserIterator) User() (*UserEntity, error)
type UserJoin ¶ added in v0.9.7
type UserJoin struct {
On, Where *UserCriteria
Fetch bool
Kind JoinType
JoinAuthor *UserJoin
JoinModifier *UserJoin
}
type UserPatch ¶
type UserPatch struct { ConfirmationToken []byte CreatedAt pq.NullTime CreatedBy ntypes.Int64 FirstName ntypes.String IsActive ntypes.Bool IsConfirmed ntypes.Bool IsStaff ntypes.Bool IsSuperuser ntypes.Bool LastLoginAt pq.NullTime LastName ntypes.String Password []byte UpdatedAt pq.NullTime UpdatedBy ntypes.Int64 Username ntypes.String }
type UserPermissionsCountExpr ¶ added in v0.9.7
type UserPermissionsCountExpr struct { Where *UserPermissionsCriteria JoinUser *UserJoin JoinAuthor *UserJoin JoinModifier *UserJoin }
type UserPermissionsCriteria ¶
type UserPermissionsCriteria struct { CreatedAt *qtypes.Timestamp CreatedBy *qtypes.Int64 PermissionAction *qtypes.String PermissionModule *qtypes.String PermissionSubsystem *qtypes.String UpdatedAt *qtypes.Timestamp UpdatedBy *qtypes.Int64 UserID *qtypes.Int64 // contains filtered or unexported fields }
func UserPermissionsAnd ¶ added in v0.18.0
func UserPermissionsAnd(operands ...*UserPermissionsCriteria) *UserPermissionsCriteria
func UserPermissionsOperand ¶ added in v0.18.0
func UserPermissionsOperand(operator string, operands ...*UserPermissionsCriteria) *UserPermissionsCriteria
func UserPermissionsOr ¶ added in v0.18.0
func UserPermissionsOr(operands ...*UserPermissionsCriteria) *UserPermissionsCriteria
type UserPermissionsEntity ¶
type UserPermissionsEntity struct { // CreatedAt ... CreatedAt time.Time // CreatedBy ... CreatedBy ntypes.Int64 // PermissionAction ... PermissionAction string // PermissionModule ... PermissionModule string // PermissionSubsystem ... PermissionSubsystem string // UpdatedAt ... UpdatedAt pq.NullTime // UpdatedBy ... UpdatedBy ntypes.Int64 // UserID ... UserID int64 // User ... User *UserEntity // Author ... Author *UserEntity // Modifier ... Modifier *UserEntity }
UserPermissionsEntity ...
func ScanUserPermissionsRows ¶
func ScanUserPermissionsRows(rows Rows) (entities []*UserPermissionsEntity, err error)
ScanUserPermissionsRows helps to scan rows straight to the slice of entities.
func (*UserPermissionsEntity) Prop ¶
func (e *UserPermissionsEntity) Prop(cn string) (interface{}, bool)
func (*UserPermissionsEntity) Props ¶
func (e *UserPermissionsEntity) Props(cns ...string) ([]interface{}, error)
type UserPermissionsFindExpr ¶ added in v0.9.7
type UserPermissionsIterator ¶
type UserPermissionsIterator struct {
// contains filtered or unexported fields
}
UserPermissionsIterator is not thread safe.
func (*UserPermissionsIterator) Close ¶
func (i *UserPermissionsIterator) Close() error
func (*UserPermissionsIterator) Columns ¶
func (i *UserPermissionsIterator) Columns() ([]string, error)
Columns is wrapper around sql.Rows.Columns method, that also cache output inside iterator.
func (*UserPermissionsIterator) Ent ¶
func (i *UserPermissionsIterator) Ent() (interface{}, error)
Ent is wrapper around UserPermissions method that makes iterator more generic.
func (*UserPermissionsIterator) Err ¶
func (i *UserPermissionsIterator) Err() error
func (*UserPermissionsIterator) Next ¶
func (i *UserPermissionsIterator) Next() bool
func (*UserPermissionsIterator) UserPermissions ¶
func (i *UserPermissionsIterator) UserPermissions() (*UserPermissionsEntity, error)
type UserPermissionsJoin ¶ added in v0.9.7
type UserPermissionsPatch ¶
type UserPermissionsProvider ¶
type UserPermissionsProvider interface { Insert(context.Context, *UserPermissionsEntity) (*UserPermissionsEntity, error) DeleteByUserID(context.Context, int64) (int64, error) }
UserPermissionsProvider ...
func NewUserPermissionsRepository ¶
func NewUserPermissionsRepository(dbPool *sql.DB) UserPermissionsProvider
NewUserPermissionsRepository ...
type UserPermissionsRepository ¶
type UserPermissionsRepository struct { UserPermissionsRepositoryBase // contains filtered or unexported fields }
UserPermissionsRepository extends UserPermissionsRepositoryBase
func (*UserPermissionsRepository) DeleteByUserID ¶ added in v0.8.4
DeleteByUserID removes all permissions of given user.
type UserPermissionsRepositoryBase ¶
func (*UserPermissionsRepositoryBase) BeginTx ¶ added in v0.18.0
func (r *UserPermissionsRepositoryBase) BeginTx(ctx context.Context) (*UserPermissionsRepositoryBaseTx, error)
func (*UserPermissionsRepositoryBase) Count ¶
func (r *UserPermissionsRepositoryBase) Count(ctx context.Context, exp *UserPermissionsCountExpr) (int64, error)
func (*UserPermissionsRepositoryBase) Find ¶
func (r *UserPermissionsRepositoryBase) Find(ctx context.Context, fe *UserPermissionsFindExpr) ([]*UserPermissionsEntity, error)
func (*UserPermissionsRepositoryBase) FindIter ¶
func (r *UserPermissionsRepositoryBase) FindIter(ctx context.Context, fe *UserPermissionsFindExpr) (*UserPermissionsIterator, error)
func (*UserPermissionsRepositoryBase) FindOneByUserIDAndPermissionSubsystemAndPermissionModuleAndPermissionAction ¶
func (r *UserPermissionsRepositoryBase) FindOneByUserIDAndPermissionSubsystemAndPermissionModuleAndPermissionAction(ctx context.Context, userPermissionsUserID int64, userPermissionsPermissionSubsystem string, userPermissionsPermissionModule string, userPermissionsPermissionAction string) (*UserPermissionsEntity, error)
func (*UserPermissionsRepositoryBase) FindQuery ¶ added in v0.9.0
func (r *UserPermissionsRepositoryBase) FindQuery(fe *UserPermissionsFindExpr) (string, []interface{}, error)
func (*UserPermissionsRepositoryBase) Insert ¶
func (r *UserPermissionsRepositoryBase) Insert(ctx context.Context, e *UserPermissionsEntity) (*UserPermissionsEntity, error)
func (*UserPermissionsRepositoryBase) InsertQuery ¶ added in v0.9.0
func (r *UserPermissionsRepositoryBase) InsertQuery(e *UserPermissionsEntity, read bool) (string, []interface{}, error)
func (UserPermissionsRepositoryBase) RunInTransaction ¶ added in v0.18.0
func (r UserPermissionsRepositoryBase) RunInTransaction(ctx context.Context, fn func(rtx *UserPermissionsRepositoryBaseTx) error, attempts int) (err error)
func (*UserPermissionsRepositoryBase) Tx ¶ added in v0.18.0
func (r *UserPermissionsRepositoryBase) Tx(tx *sql.Tx) (*UserPermissionsRepositoryBaseTx, error)
func (*UserPermissionsRepositoryBase) UpdateOneByUserIDAndPermissionSubsystemAndPermissionModuleAndPermissionAction ¶
func (r *UserPermissionsRepositoryBase) UpdateOneByUserIDAndPermissionSubsystemAndPermissionModuleAndPermissionAction(ctx context.Context, userPermissionsUserID int64, userPermissionsPermissionSubsystem string, userPermissionsPermissionModule string, userPermissionsPermissionAction string, p *UserPermissionsPatch) (*UserPermissionsEntity, error)
func (*UserPermissionsRepositoryBase) UpdateOneByUserIDAndPermissionSubsystemAndPermissionModuleAndPermissionActionQuery ¶ added in v0.9.0
func (r *UserPermissionsRepositoryBase) UpdateOneByUserIDAndPermissionSubsystemAndPermissionModuleAndPermissionActionQuery(userPermissionsUserID int64, userPermissionsPermissionSubsystem string, userPermissionsPermissionModule string, userPermissionsPermissionAction string, p *UserPermissionsPatch) (string, []interface{}, error)
func (*UserPermissionsRepositoryBase) Upsert ¶
func (r *UserPermissionsRepositoryBase) Upsert(ctx context.Context, e *UserPermissionsEntity, p *UserPermissionsPatch, inf ...string) (*UserPermissionsEntity, error)
func (*UserPermissionsRepositoryBase) UpsertQuery ¶ added in v0.9.0
func (r *UserPermissionsRepositoryBase) UpsertQuery(e *UserPermissionsEntity, p *UserPermissionsPatch, inf ...string) (string, []interface{}, error)
type UserPermissionsRepositoryBaseTx ¶ added in v0.18.0
type UserPermissionsRepositoryBaseTx struct {
// contains filtered or unexported fields
}
func (UserPermissionsRepositoryBaseTx) Commit ¶ added in v0.18.0
func (r UserPermissionsRepositoryBaseTx) Commit() error
func (*UserPermissionsRepositoryBaseTx) Count ¶ added in v0.18.0
func (r *UserPermissionsRepositoryBaseTx) Count(ctx context.Context, exp *UserPermissionsCountExpr) (int64, error)
func (*UserPermissionsRepositoryBaseTx) Find ¶ added in v0.18.0
func (r *UserPermissionsRepositoryBaseTx) Find(ctx context.Context, fe *UserPermissionsFindExpr) ([]*UserPermissionsEntity, error)
func (*UserPermissionsRepositoryBaseTx) FindIter ¶ added in v0.18.0
func (r *UserPermissionsRepositoryBaseTx) FindIter(ctx context.Context, fe *UserPermissionsFindExpr) (*UserPermissionsIterator, error)
func (*UserPermissionsRepositoryBaseTx) Insert ¶ added in v0.18.0
func (r *UserPermissionsRepositoryBaseTx) Insert(ctx context.Context, e *UserPermissionsEntity) (*UserPermissionsEntity, error)
func (UserPermissionsRepositoryBaseTx) Rollback ¶ added in v0.18.0
func (r UserPermissionsRepositoryBaseTx) Rollback() error
func (*UserPermissionsRepositoryBaseTx) UpdateOneByUserIDAndPermissionSubsystemAndPermissionModuleAndPermissionAction ¶ added in v0.18.0
func (r *UserPermissionsRepositoryBaseTx) UpdateOneByUserIDAndPermissionSubsystemAndPermissionModuleAndPermissionAction(ctx context.Context, userPermissionsUserID int64, userPermissionsPermissionSubsystem string, userPermissionsPermissionModule string, userPermissionsPermissionAction string, p *UserPermissionsPatch) (*UserPermissionsEntity, error)
func (*UserPermissionsRepositoryBaseTx) Upsert ¶ added in v0.18.0
func (r *UserPermissionsRepositoryBaseTx) Upsert(ctx context.Context, e *UserPermissionsEntity, p *UserPermissionsPatch, inf ...string) (*UserPermissionsEntity, error)
type UserProvider ¶
type UserProvider interface { Exists(context.Context, int64) (bool, error) Create(context.Context, *UserEntity) (*UserEntity, error) Insert(context.Context, *UserEntity) (*UserEntity, error) CreateSuperuser(ctx context.Context, username string, password []byte, FirstName, LastName string) (*UserEntity, error) // Count retrieves number of all users. Count(context.Context) (int64, error) UpdateLastLoginAt(ctx context.Context, id int64) (int64, error) ChangePassword(ctx context.Context, id int64, password string) error Find(context.Context, *UserFindExpr) ([]*UserEntity, error) FindOneByID(context.Context, int64) (*UserEntity, error) FindOneByUsername(context.Context, string) (*UserEntity, error) DeleteOneByID(context.Context, int64) (int64, error) UpdateOneByID(context.Context, int64, *UserPatch) (*UserEntity, error) RegistrationConfirmation(ctx context.Context, id int64, confirmationToken string) (int64, error) IsGranted(ctx context.Context, id int64, permission charon.Permission) (bool, error) SetPermissions(ctx context.Context, id int64, permissions ...charon.Permission) (int64, int64, error) }
UserProvider wraps UserRepository into interface.
type UserRepository ¶
type UserRepository struct {
UserRepositoryBase
}
UserRepository extends UserRepositoryBase.
func NewUserRepository ¶
func NewUserRepository(dbPool *sql.DB) *UserRepository
NewUserRepository alocates new UserRepository instance
func (*UserRepository) ChangePassword ¶
ChangePassword ...
func (*UserRepository) Count ¶
func (ur *UserRepository) Count(ctx context.Context) (n int64, err error)
Count implements UserProvider interface.
func (*UserRepository) Create ¶
func (ur *UserRepository) Create(ctx context.Context, ent *UserEntity) (*UserEntity, error)
Create implements UserProvider interface.
func (*UserRepository) CreateSuperuser ¶
func (ur *UserRepository) CreateSuperuser(ctx context.Context, username string, password []byte, firstName, lastName string) (*UserEntity, error)
CreateSuperuser implements UserProvider interface.
func (*UserRepository) FindOneBy ¶
func (ur *UserRepository) FindOneBy(ctx context.Context, fieldName string, value interface{}) (*UserEntity, error)
FindOneBy ...
func (*UserRepository) FindOneByUsername ¶
func (ur *UserRepository) FindOneByUsername(ctx context.Context, username string) (*UserEntity, error)
FindOneByUsername ...
func (*UserRepository) IsGranted ¶
func (ur *UserRepository) IsGranted(ctx context.Context, id int64, p charon.Permission) (bool, error)
IsGranted implements UserProvider interface.
func (*UserRepository) RegistrationConfirmation ¶
func (ur *UserRepository) RegistrationConfirmation(ctx context.Context, userID int64, confirmationToken string) (int64, error)
RegistrationConfirmation ...
func (*UserRepository) SetPermissions ¶
func (ur *UserRepository) SetPermissions(ctx context.Context, id int64, p ...charon.Permission) (int64, int64, error)
SetPermissions implements UserProvider interface.
func (*UserRepository) UpdateLastLoginAt ¶
UpdateLastLoginAt implements UserProvider interface.
type UserRepositoryBase ¶
func (*UserRepositoryBase) BeginTx ¶ added in v0.18.0
func (r *UserRepositoryBase) BeginTx(ctx context.Context) (*UserRepositoryBaseTx, error)
func (*UserRepositoryBase) Count ¶
func (r *UserRepositoryBase) Count(ctx context.Context, exp *UserCountExpr) (int64, error)
func (*UserRepositoryBase) DeleteOneByID ¶
func (*UserRepositoryBase) Find ¶
func (r *UserRepositoryBase) Find(ctx context.Context, fe *UserFindExpr) ([]*UserEntity, error)
func (*UserRepositoryBase) FindIter ¶
func (r *UserRepositoryBase) FindIter(ctx context.Context, fe *UserFindExpr) (*UserIterator, error)
func (*UserRepositoryBase) FindOneByID ¶
func (r *UserRepositoryBase) FindOneByID(ctx context.Context, pk int64) (*UserEntity, error)
func (*UserRepositoryBase) FindOneByIDAndUpdate ¶ added in v0.18.0
func (r *UserRepositoryBase) FindOneByIDAndUpdate(ctx context.Context, pk int64, p *UserPatch) (before, after *UserEntity, err error)
func (*UserRepositoryBase) FindOneByUsername ¶
func (r *UserRepositoryBase) FindOneByUsername(ctx context.Context, userUsername string) (*UserEntity, error)
func (*UserRepositoryBase) FindQuery ¶ added in v0.9.0
func (r *UserRepositoryBase) FindQuery(fe *UserFindExpr) (string, []interface{}, error)
func (*UserRepositoryBase) Insert ¶
func (r *UserRepositoryBase) Insert(ctx context.Context, e *UserEntity) (*UserEntity, error)
func (*UserRepositoryBase) InsertQuery ¶ added in v0.9.0
func (r *UserRepositoryBase) InsertQuery(e *UserEntity, read bool) (string, []interface{}, error)
func (UserRepositoryBase) RunInTransaction ¶ added in v0.18.0
func (r UserRepositoryBase) RunInTransaction(ctx context.Context, fn func(rtx *UserRepositoryBaseTx) error, attempts int) (err error)
func (*UserRepositoryBase) Tx ¶ added in v0.18.0
func (r *UserRepositoryBase) Tx(tx *sql.Tx) (*UserRepositoryBaseTx, error)
func (*UserRepositoryBase) UpdateOneByID ¶
func (r *UserRepositoryBase) UpdateOneByID(ctx context.Context, pk int64, p *UserPatch) (*UserEntity, error)
func (*UserRepositoryBase) UpdateOneByIDQuery ¶ added in v0.9.0
func (r *UserRepositoryBase) UpdateOneByIDQuery(pk int64, p *UserPatch) (string, []interface{}, error)
func (*UserRepositoryBase) UpdateOneByUsername ¶
func (r *UserRepositoryBase) UpdateOneByUsername(ctx context.Context, userUsername string, p *UserPatch) (*UserEntity, error)
func (*UserRepositoryBase) UpdateOneByUsernameQuery ¶ added in v0.9.0
func (r *UserRepositoryBase) UpdateOneByUsernameQuery(userUsername string, p *UserPatch) (string, []interface{}, error)
func (*UserRepositoryBase) Upsert ¶
func (r *UserRepositoryBase) Upsert(ctx context.Context, e *UserEntity, p *UserPatch, inf ...string) (*UserEntity, error)
func (*UserRepositoryBase) UpsertQuery ¶ added in v0.9.0
func (r *UserRepositoryBase) UpsertQuery(e *UserEntity, p *UserPatch, inf ...string) (string, []interface{}, error)
type UserRepositoryBaseTx ¶ added in v0.18.0
type UserRepositoryBaseTx struct {
// contains filtered or unexported fields
}
func (UserRepositoryBaseTx) Commit ¶ added in v0.18.0
func (r UserRepositoryBaseTx) Commit() error
func (*UserRepositoryBaseTx) Count ¶ added in v0.18.0
func (r *UserRepositoryBaseTx) Count(ctx context.Context, exp *UserCountExpr) (int64, error)
func (*UserRepositoryBaseTx) DeleteOneByID ¶ added in v0.18.0
func (*UserRepositoryBaseTx) Find ¶ added in v0.18.0
func (r *UserRepositoryBaseTx) Find(ctx context.Context, fe *UserFindExpr) ([]*UserEntity, error)
func (*UserRepositoryBaseTx) FindIter ¶ added in v0.18.0
func (r *UserRepositoryBaseTx) FindIter(ctx context.Context, fe *UserFindExpr) (*UserIterator, error)
func (*UserRepositoryBaseTx) FindOneByID ¶ added in v0.18.0
func (r *UserRepositoryBaseTx) FindOneByID(ctx context.Context, pk int64) (*UserEntity, error)
func (*UserRepositoryBaseTx) Insert ¶ added in v0.18.0
func (r *UserRepositoryBaseTx) Insert(ctx context.Context, e *UserEntity) (*UserEntity, error)
func (UserRepositoryBaseTx) Rollback ¶ added in v0.18.0
func (r UserRepositoryBaseTx) Rollback() error
func (*UserRepositoryBaseTx) UpdateOneByID ¶ added in v0.18.0
func (r *UserRepositoryBaseTx) UpdateOneByID(ctx context.Context, pk int64, p *UserPatch) (*UserEntity, error)
func (*UserRepositoryBaseTx) UpdateOneByUsername ¶ added in v0.18.0
func (r *UserRepositoryBaseTx) UpdateOneByUsername(ctx context.Context, userUsername string, p *UserPatch) (*UserEntity, error)
func (*UserRepositoryBaseTx) Upsert ¶ added in v0.18.0
func (r *UserRepositoryBaseTx) Upsert(ctx context.Context, e *UserEntity, p *UserPatch, inf ...string) (*UserEntity, error)