mock

package
v0.0.0-...-83335df Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DbScenario

func DbScenario(t *testing.T, handle func(tx *gorm.DB))

Types

type MockDomain

type MockDomain struct {
	ID uint
}

type MockIdentity

type MockIdentity struct {
	ID        uint
	SuperUser bool
	Role      *yauthorization.RoleIdentity
}

func (*MockIdentity) DeleteRole

func (*MockIdentity) DeleteRole(tx *gorm.DB, roleID uint) error

DeleteRole implements yauthorization.Identity.

func (*MockIdentity) GetRole

func (*MockIdentity) GetRole(tx *gorm.DB, domainID uint) (*yauthorization.RoleIdentity, error)

GetRole implements yauthorization.Identity.

func (*MockIdentity) GetUserID

func (ident *MockIdentity) GetUserID() uint

func (*MockIdentity) IdentityID

func (ident *MockIdentity) IdentityID() uint

func (*MockIdentity) IsSuperUser

func (ident *MockIdentity) IsSuperUser() bool

func (*MockIdentity) SetRole

func (*MockIdentity) SetRole(tx *gorm.DB, role *yauthorization.RoleIdentity) error

SetRole implements yauthorization.Identity.

func (*MockIdentity) WithPermission

func (ident *MockIdentity) WithPermission(
	t *testing.T,
	perms []*yauthorization.EntityPermission,
	db *gorm.DB,
	handler func(perms []*yauthorization.EntityPermission),
)

type MockOrder

type MockOrder struct {
	ID       uint `gorm:"primarykey"`
	Name     string
	DomainID uint
}

func (*MockOrder) GetDomainID

func (mo *MockOrder) GetDomainID() uint

func (*MockOrder) GetEntityID

func (*MockOrder) GetEntityID() string

GetEntityID implements yauthorization.Entity.

func (*MockOrder) Permission

type MockUpBy

type MockUpBy struct {
	ID          uint `gorm:"primarykey"`
	UpdatedByID uint
}

func (*MockUpBy) GetDomainID

func (mo *MockUpBy) GetDomainID() uint

func (*MockUpBy) GetEntityID

func (*MockUpBy) GetEntityID() string

GetEntityID implements yauthorization.Entity.

func (*MockUpBy) Permission

func (*MockUpBy) SetUpdateByID

func (mo *MockUpBy) SetUpdateByID(idnya uint)

Jump to

Keyboard shortcuts

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