mocks

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: MIT Imports: 4 Imported by: 0 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

This section is empty.

Types

type MockAPIKeyVerifier

type MockAPIKeyVerifier struct {
	mock.Mock
}

MockAPIKeyVerifier is an autogenerated mock type for the APIKeyVerifier type

func NewMockAPIKeyVerifier

func NewMockAPIKeyVerifier(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockAPIKeyVerifier

NewMockAPIKeyVerifier creates a new instance of MockAPIKeyVerifier. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockAPIKeyVerifier) EXPECT

func (*MockAPIKeyVerifier) UpdateLastUsed

func (_mock *MockAPIKeyVerifier) UpdateLastUsed(ctx context.Context, id int, ip string) error

UpdateLastUsed provides a mock function for the type MockAPIKeyVerifier

func (*MockAPIKeyVerifier) Verify

func (_mock *MockAPIKeyVerifier) Verify(ctx context.Context, fullKey string) (*apikey.APIKey, error)

Verify provides a mock function for the type MockAPIKeyVerifier

type MockAPIKeyVerifier_Expecter

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

func (*MockAPIKeyVerifier_Expecter) UpdateLastUsed

UpdateLastUsed is a helper method to define mock.On call

  • ctx context.Context
  • id int
  • ip string

func (*MockAPIKeyVerifier_Expecter) Verify

Verify is a helper method to define mock.On call

  • ctx context.Context
  • fullKey string

type MockAPIKeyVerifier_UpdateLastUsed_Call

type MockAPIKeyVerifier_UpdateLastUsed_Call struct {
	*mock.Call
}

MockAPIKeyVerifier_UpdateLastUsed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateLastUsed'

func (*MockAPIKeyVerifier_UpdateLastUsed_Call) Return

func (*MockAPIKeyVerifier_UpdateLastUsed_Call) Run

func (*MockAPIKeyVerifier_UpdateLastUsed_Call) RunAndReturn

type MockAPIKeyVerifier_Verify_Call

type MockAPIKeyVerifier_Verify_Call struct {
	*mock.Call
}

MockAPIKeyVerifier_Verify_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Verify'

func (*MockAPIKeyVerifier_Verify_Call) Return

func (*MockAPIKeyVerifier_Verify_Call) Run

func (*MockAPIKeyVerifier_Verify_Call) RunAndReturn

type MockRoleCapabilities added in v1.1.0

type MockRoleCapabilities struct {
	mock.Mock
}

MockRoleCapabilities is an autogenerated mock type for the RoleCapabilities type

func NewMockRoleCapabilities added in v1.1.0

func NewMockRoleCapabilities(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockRoleCapabilities

NewMockRoleCapabilities creates a new instance of MockRoleCapabilities. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockRoleCapabilities) CanComment added in v1.1.0

func (_mock *MockRoleCapabilities) CanComment(name string) bool

CanComment provides a mock function for the type MockRoleCapabilities

func (*MockRoleCapabilities) CanManageType added in v1.1.0

func (_mock *MockRoleCapabilities) CanManageType(name string, postTypeSlug string) bool

CanManageType provides a mock function for the type MockRoleCapabilities

func (*MockRoleCapabilities) CanMedia added in v1.1.0

func (_mock *MockRoleCapabilities) CanMedia(name string) bool

CanMedia provides a mock function for the type MockRoleCapabilities

func (*MockRoleCapabilities) CanPublish added in v1.1.0

func (_mock *MockRoleCapabilities) CanPublish(name string) bool

CanPublish provides a mock function for the type MockRoleCapabilities

func (*MockRoleCapabilities) EXPECT added in v1.1.0

func (*MockRoleCapabilities) IsAdmin added in v1.1.0

func (_mock *MockRoleCapabilities) IsAdmin(name string) bool

IsAdmin provides a mock function for the type MockRoleCapabilities

type MockRoleCapabilities_CanComment_Call added in v1.1.0

type MockRoleCapabilities_CanComment_Call struct {
	*mock.Call
}

MockRoleCapabilities_CanComment_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CanComment'

func (*MockRoleCapabilities_CanComment_Call) Return added in v1.1.0

func (*MockRoleCapabilities_CanComment_Call) Run added in v1.1.0

func (*MockRoleCapabilities_CanComment_Call) RunAndReturn added in v1.1.0

type MockRoleCapabilities_CanManageType_Call added in v1.1.0

type MockRoleCapabilities_CanManageType_Call struct {
	*mock.Call
}

MockRoleCapabilities_CanManageType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CanManageType'

func (*MockRoleCapabilities_CanManageType_Call) Return added in v1.1.0

func (*MockRoleCapabilities_CanManageType_Call) Run added in v1.1.0

func (*MockRoleCapabilities_CanManageType_Call) RunAndReturn added in v1.1.0

type MockRoleCapabilities_CanMedia_Call added in v1.1.0

type MockRoleCapabilities_CanMedia_Call struct {
	*mock.Call
}

MockRoleCapabilities_CanMedia_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CanMedia'

func (*MockRoleCapabilities_CanMedia_Call) Return added in v1.1.0

func (*MockRoleCapabilities_CanMedia_Call) Run added in v1.1.0

func (*MockRoleCapabilities_CanMedia_Call) RunAndReturn added in v1.1.0

type MockRoleCapabilities_CanPublish_Call added in v1.1.0

type MockRoleCapabilities_CanPublish_Call struct {
	*mock.Call
}

MockRoleCapabilities_CanPublish_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CanPublish'

func (*MockRoleCapabilities_CanPublish_Call) Return added in v1.1.0

func (*MockRoleCapabilities_CanPublish_Call) Run added in v1.1.0

func (*MockRoleCapabilities_CanPublish_Call) RunAndReturn added in v1.1.0

type MockRoleCapabilities_Expecter added in v1.1.0

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

func (*MockRoleCapabilities_Expecter) CanComment added in v1.1.0

CanComment is a helper method to define mock.On call

  • name string

func (*MockRoleCapabilities_Expecter) CanManageType added in v1.1.0

func (_e *MockRoleCapabilities_Expecter) CanManageType(name any, postTypeSlug any) *MockRoleCapabilities_CanManageType_Call

CanManageType is a helper method to define mock.On call

  • name string
  • postTypeSlug string

func (*MockRoleCapabilities_Expecter) CanMedia added in v1.1.0

CanMedia is a helper method to define mock.On call

  • name string

func (*MockRoleCapabilities_Expecter) CanPublish added in v1.1.0

CanPublish is a helper method to define mock.On call

  • name string

func (*MockRoleCapabilities_Expecter) IsAdmin added in v1.1.0

IsAdmin is a helper method to define mock.On call

  • name string

type MockRoleCapabilities_IsAdmin_Call added in v1.1.0

type MockRoleCapabilities_IsAdmin_Call struct {
	*mock.Call
}

MockRoleCapabilities_IsAdmin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsAdmin'

func (*MockRoleCapabilities_IsAdmin_Call) Return added in v1.1.0

func (*MockRoleCapabilities_IsAdmin_Call) Run added in v1.1.0

func (*MockRoleCapabilities_IsAdmin_Call) RunAndReturn added in v1.1.0

type MockUserLookup

type MockUserLookup struct {
	mock.Mock
}

MockUserLookup is an autogenerated mock type for the UserLookup type

func NewMockUserLookup

func NewMockUserLookup(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockUserLookup

NewMockUserLookup creates a new instance of MockUserLookup. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockUserLookup) EXPECT

func (*MockUserLookup) GetUserByID

func (_mock *MockUserLookup) GetUserByID(ctx context.Context, userID int) (*user.User, error)

GetUserByID provides a mock function for the type MockUserLookup

type MockUserLookup_Expecter

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

func (*MockUserLookup_Expecter) GetUserByID

func (_e *MockUserLookup_Expecter) GetUserByID(ctx any, userID any) *MockUserLookup_GetUserByID_Call

GetUserByID is a helper method to define mock.On call

  • ctx context.Context
  • userID int

type MockUserLookup_GetUserByID_Call

type MockUserLookup_GetUserByID_Call struct {
	*mock.Call
}

MockUserLookup_GetUserByID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUserByID'

func (*MockUserLookup_GetUserByID_Call) Return

func (_c *MockUserLookup_GetUserByID_Call) Return(user1 *user.User, err error) *MockUserLookup_GetUserByID_Call

func (*MockUserLookup_GetUserByID_Call) Run

func (*MockUserLookup_GetUserByID_Call) RunAndReturn

func (_c *MockUserLookup_GetUserByID_Call) RunAndReturn(run func(ctx context.Context, userID int) (*user.User, error)) *MockUserLookup_GetUserByID_Call

Jump to

Keyboard shortcuts

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