mocks

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromTemplate

func FromTemplate() source.Source

Types

type Nerv

type Nerv struct {
	Source
	sync.Mutex
	// contains filtered or unexported fields
}

func (*Nerv) SetDaemonRunning

func (n *Nerv) SetDaemonRunning(status bool)

func (*Nerv) StartCustomEvent

func (n *Nerv) StartCustomEvent(event *types.WorkloadEventMessage)

func (*Nerv) StartEvents

func (n *Nerv) StartEvents()

StartEvents starts the events: Shinji 400%, Asuka starts, Asuka dies, Rei dies

type Source

type Source struct {
	mock.Mock
}

Source is an autogenerated mock type for the Source type

func NewSource

func NewSource(t interface {
	mock.TestingT
	Cleanup(func())
}) *Source

NewSource creates a new instance of Source. 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 (*Source) Alive

func (_mock *Source) Alive(ctx context.Context) bool

Alive provides a mock function for the type Source

func (*Source) EXPECT

func (_m *Source) EXPECT() *Source_Expecter

func (*Source) Events

func (_mock *Source) Events(ctx context.Context) (<-chan *types.WorkloadEventMessage, <-chan error)

Events provides a mock function for the type Source

func (*Source) Get

func (_mock *Source) Get(ctx context.Context, ID string) (*source.Workload, error)

Get provides a mock function for the type Source

func (*Source) List

func (_mock *Source) List(ctx context.Context) ([]*source.Workload, error)

List provides a mock function for the type Source

type Source_Alive_Call

type Source_Alive_Call struct {
	*mock.Call
}

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

func (*Source_Alive_Call) Return

func (_c *Source_Alive_Call) Return(b bool) *Source_Alive_Call

func (*Source_Alive_Call) Run

func (_c *Source_Alive_Call) Run(run func(ctx context.Context)) *Source_Alive_Call

func (*Source_Alive_Call) RunAndReturn

func (_c *Source_Alive_Call) RunAndReturn(run func(ctx context.Context) bool) *Source_Alive_Call

type Source_Events_Call

type Source_Events_Call struct {
	*mock.Call
}

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

func (*Source_Events_Call) Return

func (_c *Source_Events_Call) Return(workloadEventMessageCh <-chan *types.WorkloadEventMessage, errCh <-chan error) *Source_Events_Call

func (*Source_Events_Call) Run

func (_c *Source_Events_Call) Run(run func(ctx context.Context)) *Source_Events_Call

func (*Source_Events_Call) RunAndReturn

func (_c *Source_Events_Call) RunAndReturn(run func(ctx context.Context) (<-chan *types.WorkloadEventMessage, <-chan error)) *Source_Events_Call

type Source_Expecter

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

func (*Source_Expecter) Alive

func (_e *Source_Expecter) Alive(ctx any) *Source_Alive_Call

Alive is a helper method to define mock.On call

  • ctx context.Context

func (*Source_Expecter) Events

func (_e *Source_Expecter) Events(ctx any) *Source_Events_Call

Events is a helper method to define mock.On call

  • ctx context.Context

func (*Source_Expecter) Get

func (_e *Source_Expecter) Get(ctx any, ID any) *Source_Get_Call

Get is a helper method to define mock.On call

  • ctx context.Context
  • ID string

func (*Source_Expecter) List

func (_e *Source_Expecter) List(ctx any) *Source_List_Call

List is a helper method to define mock.On call

  • ctx context.Context

type Source_Get_Call

type Source_Get_Call struct {
	*mock.Call
}

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

func (*Source_Get_Call) Return

func (_c *Source_Get_Call) Return(workload *source.Workload, err error) *Source_Get_Call

func (*Source_Get_Call) Run

func (_c *Source_Get_Call) Run(run func(ctx context.Context, ID string)) *Source_Get_Call

func (*Source_Get_Call) RunAndReturn

func (_c *Source_Get_Call) RunAndReturn(run func(ctx context.Context, ID string) (*source.Workload, error)) *Source_Get_Call

type Source_List_Call

type Source_List_Call struct {
	*mock.Call
}

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

func (*Source_List_Call) Return

func (_c *Source_List_Call) Return(workloads []*source.Workload, err error) *Source_List_Call

func (*Source_List_Call) Run

func (_c *Source_List_Call) Run(run func(ctx context.Context)) *Source_List_Call

func (*Source_List_Call) RunAndReturn

func (_c *Source_List_Call) RunAndReturn(run func(ctx context.Context) ([]*source.Workload, error)) *Source_List_Call

Jump to

Keyboard shortcuts

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