permission_model

package
v0.0.0-...-1dc8ef7 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

type Model interface {
	PermissionModel
	db.AutoMigrater
}

func New

func New(db *gorm.DB) Model

type Permission

type Permission struct {
	Id      string `gorm:"not null;uniqueIndex"`
	Comment string
}

type PermissionModel

type PermissionModel interface {
	ReadPermissionById(permissionId string) (*Permission, error)
	UpdatePermissionById(permissionId string, params PermissionParams) error
	DeletePermissionById(permissionId string) (*Permission, error)
	CreatePermission(params PermissionParams) error
	ReadPermissionsByKeys(keys []string) ([]*Permission, error)
	ReadAllPermissions() ([]*Permission, error)
	IsPermissionsExist([]string) ([]string, bool)
	ReadPermissionByQuery(ids []string, query string) ([]*Permission, error)
}

type PermissionParams

type PermissionParams struct {
	Id      string
	Comment string
}

Jump to

Keyboard shortcuts

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