dbsqlite

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddOrganizationParams

type AddOrganizationParams struct {
	ID         int64
	Name       string
	SystemName string
	Status     string
}

type AddPermissionToRoleParams

type AddPermissionToRoleParams struct {
	RoleID     int64
	Permission string
}

type AddRoleParams

type AddRoleParams struct {
	ID             int64
	OrganizationID int64
	Name           string
	SystemName     string
}

type AddRoleToUserParams

type AddRoleToUserParams struct {
	UserID int64
	RoleID int64
}

type AddUserParams

type AddUserParams struct {
	ID          int64
	FirstName   string
	LastName    string
	DisplayName string
	Email       string
}

type AddUserToRoleParams

type AddUserToRoleParams struct {
	UserID int64
	RoleID int64
}

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 GetOrganizationRolesRow

type GetOrganizationRolesRow struct {
	ID         int64
	Name       string
	SystemName string
}

type GetOrganizationsRow

type GetOrganizationsRow struct {
	ID         int64
	Name       string
	SystemName string
}

type GetUserOrganizationPermissionsParams

type GetUserOrganizationPermissionsParams struct {
	UserID         int64
	OrganizationID int64
}

type GetUserOrganizationRolesParams

type GetUserOrganizationRolesParams struct {
	UserID         int64
	OrganizationID int64
}

type GetUserOrganizationRolesRow

type GetUserOrganizationRolesRow struct {
	ID         int64
	Name       string
	SystemName string
}

type GetUserOrganizationsRow

type GetUserOrganizationsRow struct {
	ID         sql.NullInt64
	Name       sql.NullString
	SystemName sql.NullString
}

type ListUserOrganizationRolesRow

type ListUserOrganizationRolesRow struct {
	OrganizationID         int64
	Organization           string
	OrganizationSystemName string
	RoleID                 int64
	RoleName               string
	RoleSystemName         string
}

type Organization

type Organization struct {
	ID         int64
	Name       string
	SystemName string
	Status     string
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) AddOrganization

func (q *Queries) AddOrganization(ctx context.Context, arg AddOrganizationParams) error

---------------------------------------------------------------------------

Organization Management

---------------------------------------------------------------------------

func (*Queries) AddPermissionToRole

func (q *Queries) AddPermissionToRole(ctx context.Context, arg AddPermissionToRoleParams) error

func (*Queries) AddRole

func (q *Queries) AddRole(ctx context.Context, arg AddRoleParams) error

---------------------------------------------------------------------------

Role Management

---------------------------------------------------------------------------

func (*Queries) AddRoleToUser

func (q *Queries) AddRoleToUser(ctx context.Context, arg AddRoleToUserParams) error

func (*Queries) AddUser

func (q *Queries) AddUser(ctx context.Context, arg AddUserParams) error

---------------------------------------------------------------------------

User Management

---------------------------------------------------------------------------

func (*Queries) AddUserToRole

func (q *Queries) AddUserToRole(ctx context.Context, arg AddUserToRoleParams) error

func (*Queries) DeleteRole

func (q *Queries) DeleteRole(ctx context.Context, id int64) error

func (*Queries) GetOrganization

func (q *Queries) GetOrganization(ctx context.Context, id int64) (Organization, error)

func (*Queries) GetOrganizationBySystemName

func (q *Queries) GetOrganizationBySystemName(ctx context.Context, systemName string) (Organization, error)

func (*Queries) GetOrganizationRoles

func (q *Queries) GetOrganizationRoles(ctx context.Context, organizationID int64) ([]GetOrganizationRolesRow, error)

func (*Queries) GetOrganizations

func (q *Queries) GetOrganizations(ctx context.Context) ([]GetOrganizationsRow, error)

func (*Queries) GetRolePermissions

func (q *Queries) GetRolePermissions(ctx context.Context, roleID int64) ([]string, error)

func (*Queries) GetUser

func (q *Queries) GetUser(ctx context.Context, id int64) (User, error)

func (*Queries) GetUserByEmail

func (q *Queries) GetUserByEmail(ctx context.Context, email string) (User, error)

func (*Queries) GetUserOrganizationPermissions

func (q *Queries) GetUserOrganizationPermissions(ctx context.Context, arg GetUserOrganizationPermissionsParams) ([]string, error)

func (*Queries) GetUserOrganizationRoles

func (q *Queries) GetUserOrganizationRoles(ctx context.Context, arg GetUserOrganizationRolesParams) ([]GetUserOrganizationRolesRow, error)

func (*Queries) GetUserOrganizations

func (q *Queries) GetUserOrganizations(ctx context.Context, userID int64) ([]GetUserOrganizationsRow, error)

func (*Queries) ListOrganizations

func (q *Queries) ListOrganizations(ctx context.Context) ([]Organization, error)

func (*Queries) ListUserOrganizationRoles

func (q *Queries) ListUserOrganizationRoles(ctx context.Context, userID int64) ([]ListUserOrganizationRolesRow, error)

func (*Queries) RemoveAllRolesFromUser

func (q *Queries) RemoveAllRolesFromUser(ctx context.Context, userID int64) error

func (*Queries) RemovePermissionFromRole

func (q *Queries) RemovePermissionFromRole(ctx context.Context, arg RemovePermissionFromRoleParams) error

func (*Queries) RemoveUserFromRole

func (q *Queries) RemoveUserFromRole(ctx context.Context, arg RemoveUserFromRoleParams) error

func (*Queries) UpdateOrganization

func (q *Queries) UpdateOrganization(ctx context.Context, arg UpdateOrganizationParams) error

func (*Queries) UpdateRole

func (q *Queries) UpdateRole(ctx context.Context, arg UpdateRoleParams) error

func (*Queries) UpdateUser

func (q *Queries) UpdateUser(ctx context.Context, arg UpdateUserParams) error

func (*Queries) WithTx

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

type RemovePermissionFromRoleParams

type RemovePermissionFromRoleParams struct {
	RoleID     int64
	Permission string
}

type RemoveUserFromRoleParams

type RemoveUserFromRoleParams struct {
	UserID int64
	RoleID int64
}

type ResourceType

type ResourceType struct {
	ID         int64
	Name       string
	SystemName string
}

type Role

type Role struct {
	ID             int64
	OrganizationID int64
	Name           string
	SystemName     string
}

type RolePermission

type RolePermission struct {
	RoleID     int64
	Permission string
}

type UpdateOrganizationParams

type UpdateOrganizationParams struct {
	Name       string
	SystemName string
	Status     string
	ID         int64
}

type UpdateRoleParams

type UpdateRoleParams struct {
	Name       string
	SystemName string
	ID         int64
}

type UpdateUserParams

type UpdateUserParams struct {
	FirstName   string
	LastName    string
	DisplayName string
	Email       string
	ID          int64
}

type User

type User struct {
	ID          int64
	FirstName   string
	LastName    string
	DisplayName string
	Email       string
}

type UserRole

type UserRole struct {
	UserID int64
	RoleID int64
}

Jump to

Keyboard shortcuts

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