messagesender

package
v0.0.0-...-05bc493 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultService

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

func NewDefaultService

func NewDefaultService(pub message.Publisher, affinity affinity.Helper, pulses beat.History) *DefaultService

func (*DefaultService) Close

func (dm *DefaultService) Close() error

func (*DefaultService) InterceptorAdd

func (dm *DefaultService) InterceptorAdd(fn InterceptorFn)

func (*DefaultService) InterceptorClear

func (dm *DefaultService) InterceptorClear()

func (*DefaultService) SendRole

func (*DefaultService) SendTarget

func (dm *DefaultService) SendTarget(ctx context.Context, msg rmsreg.GoGoSerializable, target reference.Global, opts ...SendOption) error

type InterceptorFn

type InterceptorFn func(record rmsreg.GoGoSerializable) ([]rmsreg.GoGoSerializable, bool)

type MessageRouter

type MessageRouter interface {
	CreateMessageSender(affinity.Helper, beat.History) Service
	SubscribeForMessages(func(beat.Message) error) (stopFn func())
}

type SendOption

type SendOption func(*options)

func WithSyncBody

func WithSyncBody() SendOption

nolint:unused

type Service

type Service interface {
	// blocks if network unreachable
	SendRole(ctx context.Context, msg rmsreg.GoGoSerializable, role affinity.DynamicRole, object reference.Global, pn pulse.Number, opts ...SendOption) error
	SendTarget(ctx context.Context, msg rmsreg.GoGoSerializable, target reference.Global, opts ...SendOption) error

	InterceptorAdd(fn InterceptorFn)
	InterceptorClear()
}

type ServiceMock

type ServiceMock struct {
	InterceptorAddMock mServiceMockInterceptorAdd

	InterceptorClearMock mServiceMockInterceptorClear

	SendRoleMock mServiceMockSendRole

	SendTargetMock mServiceMockSendTarget
	// contains filtered or unexported fields
}

ServiceMock implements Service

func NewServiceMock

func NewServiceMock(t minimock.Tester) *ServiceMock

NewServiceMock returns a mock for Service

func (*ServiceMock) InterceptorAdd

func (mmInterceptorAdd *ServiceMock) InterceptorAdd(fn InterceptorFn)

InterceptorAdd implements Service

func (*ServiceMock) InterceptorAddAfterCounter

func (mmInterceptorAdd *ServiceMock) InterceptorAddAfterCounter() uint64

InterceptorAddAfterCounter returns a count of finished ServiceMock.InterceptorAdd invocations

func (*ServiceMock) InterceptorAddBeforeCounter

func (mmInterceptorAdd *ServiceMock) InterceptorAddBeforeCounter() uint64

InterceptorAddBeforeCounter returns a count of ServiceMock.InterceptorAdd invocations

func (*ServiceMock) InterceptorClear

func (mmInterceptorClear *ServiceMock) InterceptorClear()

InterceptorClear implements Service

func (*ServiceMock) InterceptorClearAfterCounter

func (mmInterceptorClear *ServiceMock) InterceptorClearAfterCounter() uint64

InterceptorClearAfterCounter returns a count of finished ServiceMock.InterceptorClear invocations

func (*ServiceMock) InterceptorClearBeforeCounter

func (mmInterceptorClear *ServiceMock) InterceptorClearBeforeCounter() uint64

InterceptorClearBeforeCounter returns a count of ServiceMock.InterceptorClear invocations

func (*ServiceMock) MinimockFinish

func (m *ServiceMock) MinimockFinish()

MinimockFinish checks that all mocked methods have been called the expected number of times

func (*ServiceMock) MinimockInterceptorAddDone

func (m *ServiceMock) MinimockInterceptorAddDone() bool

MinimockInterceptorAddDone returns true if the count of the InterceptorAdd invocations corresponds the number of defined expectations

func (*ServiceMock) MinimockInterceptorAddInspect

func (m *ServiceMock) MinimockInterceptorAddInspect()

MinimockInterceptorAddInspect logs each unmet expectation

func (*ServiceMock) MinimockInterceptorClearDone

func (m *ServiceMock) MinimockInterceptorClearDone() bool

MinimockInterceptorClearDone returns true if the count of the InterceptorClear invocations corresponds the number of defined expectations

func (*ServiceMock) MinimockInterceptorClearInspect

func (m *ServiceMock) MinimockInterceptorClearInspect()

MinimockInterceptorClearInspect logs each unmet expectation

func (*ServiceMock) MinimockSendRoleDone

func (m *ServiceMock) MinimockSendRoleDone() bool

MinimockSendRoleDone returns true if the count of the SendRole invocations corresponds the number of defined expectations

func (*ServiceMock) MinimockSendRoleInspect

func (m *ServiceMock) MinimockSendRoleInspect()

MinimockSendRoleInspect logs each unmet expectation

func (*ServiceMock) MinimockSendTargetDone

func (m *ServiceMock) MinimockSendTargetDone() bool

MinimockSendTargetDone returns true if the count of the SendTarget invocations corresponds the number of defined expectations

func (*ServiceMock) MinimockSendTargetInspect

func (m *ServiceMock) MinimockSendTargetInspect()

MinimockSendTargetInspect logs each unmet expectation

func (*ServiceMock) MinimockWait

func (m *ServiceMock) MinimockWait(timeout mm_time.Duration)

MinimockWait waits for all mocked methods to be called the expected number of times

func (*ServiceMock) SendRole

func (mmSendRole *ServiceMock) SendRole(ctx context.Context, msg rmsreg.GoGoSerializable, role affinity.DynamicRole, object reference.Global, pn pulse.Number, opts ...SendOption) (err error)

SendRole implements Service

func (*ServiceMock) SendRoleAfterCounter

func (mmSendRole *ServiceMock) SendRoleAfterCounter() uint64

SendRoleAfterCounter returns a count of finished ServiceMock.SendRole invocations

func (*ServiceMock) SendRoleBeforeCounter

func (mmSendRole *ServiceMock) SendRoleBeforeCounter() uint64

SendRoleBeforeCounter returns a count of ServiceMock.SendRole invocations

func (*ServiceMock) SendTarget

func (mmSendTarget *ServiceMock) SendTarget(ctx context.Context, msg rmsreg.GoGoSerializable, target reference.Global, opts ...SendOption) (err error)

SendTarget implements Service

func (*ServiceMock) SendTargetAfterCounter

func (mmSendTarget *ServiceMock) SendTargetAfterCounter() uint64

SendTargetAfterCounter returns a count of finished ServiceMock.SendTarget invocations

func (*ServiceMock) SendTargetBeforeCounter

func (mmSendTarget *ServiceMock) SendTargetBeforeCounter() uint64

SendTargetBeforeCounter returns a count of ServiceMock.SendTarget invocations

type ServiceMockInterceptorAddExpectation

type ServiceMockInterceptorAddExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

ServiceMockInterceptorAddExpectation specifies expectation struct of the Service.InterceptorAdd

type ServiceMockInterceptorAddParams

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

ServiceMockInterceptorAddParams contains parameters of the Service.InterceptorAdd

type ServiceMockInterceptorClearExpectation

type ServiceMockInterceptorClearExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

ServiceMockInterceptorClearExpectation specifies expectation struct of the Service.InterceptorClear

type ServiceMockSendRoleExpectation

type ServiceMockSendRoleExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

ServiceMockSendRoleExpectation specifies expectation struct of the Service.SendRole

func (*ServiceMockSendRoleExpectation) Then

Then sets up Service.SendRole return parameters for the expectation previously defined by the When method

type ServiceMockSendRoleParams

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

ServiceMockSendRoleParams contains parameters of the Service.SendRole

type ServiceMockSendRoleResults

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

ServiceMockSendRoleResults contains results of the Service.SendRole

type ServiceMockSendTargetExpectation

type ServiceMockSendTargetExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

ServiceMockSendTargetExpectation specifies expectation struct of the Service.SendTarget

func (*ServiceMockSendTargetExpectation) Then

Then sets up Service.SendTarget return parameters for the expectation previously defined by the When method

type ServiceMockSendTargetParams

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

ServiceMockSendTargetParams contains parameters of the Service.SendTarget

type ServiceMockSendTargetResults

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

ServiceMockSendTargetResults contains results of the Service.SendTarget

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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