models

package
v1.6.8 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: GPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type Queries

type Queries struct {
	// contains filtered or unexported fields
}

func New

func New(db DBTX) *Queries

func Prepare

func Prepare(ctx context.Context, db DBTX) (*Queries, error)

func (*Queries) AllGroups

func (q *Queries) AllGroups(ctx context.Context, limit int32, offset int32) ([]*permissions_models.Group, error)

func (*Queries) AllPermissions

func (q *Queries) AllPermissions(ctx context.Context, limit int32, offset int32) ([]*permissions_models.Permission, error)

func (*Queries) Close

func (q *Queries) Close() error

func (*Queries) DeleteGroup

func (q *Queries) DeleteGroup(ctx context.Context, id uint64) error

func (*Queries) DeleteGroupPermission

func (q *Queries) DeleteGroupPermission(ctx context.Context, groupID uint64, permissionID uint64) error

func (*Queries) DeletePermission

func (q *Queries) DeletePermission(ctx context.Context, id uint64) error

func (*Queries) DeleteUserGroup

func (q *Queries) DeleteUserGroup(ctx context.Context, userID uint64, groupID uint64) error

func (*Queries) GetGroupByID

func (q *Queries) GetGroupByID(ctx context.Context, id uint64) (*permissions_models.Group, error)

func (*Queries) GetPermissionByID

func (q *Queries) GetPermissionByID(ctx context.Context, id uint64) (*permissions_models.Permission, error)

func (*Queries) InsertGroup

func (q *Queries) InsertGroup(ctx context.Context, name string, description string) (int64, error)

func (*Queries) InsertGroupPermission

func (q *Queries) InsertGroupPermission(ctx context.Context, groupID uint64, permissionID uint64) (int64, error)

func (*Queries) InsertPermission

func (q *Queries) InsertPermission(ctx context.Context, name string, description string) (int64, error)

func (*Queries) InsertUserGroup

func (q *Queries) InsertUserGroup(ctx context.Context, userID uint64, groupID uint64) (int64, error)

func (*Queries) PermissionsForUser

func (q *Queries) PermissionsForUser(ctx context.Context, userID uint64) ([]*permissions_models.Permission, error)

func (*Queries) UpdateGroup

func (q *Queries) UpdateGroup(ctx context.Context, name string, description string, iD uint64) error

func (*Queries) UpdatePermission

func (q *Queries) UpdatePermission(ctx context.Context, name string, description string, iD uint64) error

func (*Queries) UserGroups

func (*Queries) UserHasPermission

func (q *Queries) UserHasPermission(ctx context.Context, userID uint64, permissionName string) (int64, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx *sql.Tx) permissions_models.Querier

Jump to

Keyboard shortcuts

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