util

package
v0.0.0-...-4dc66ed Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AckRecorder

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

AckRecorder helps to manage state of waiting Ack message

func (*AckRecorder) Ack

func (ar *AckRecorder) Ack(id string) bool

Ack removes id from waiting list

func (*AckRecorder) AddToWaitList

func (ar *AckRecorder) AddToWaitList(id string) bool

AddToWaitList adds id into waiting list

func (*AckRecorder) Clear

func (ar *AckRecorder) Clear()

Clear clears waiting list

func (*AckRecorder) HasCompleted

func (ar *AckRecorder) HasCompleted() bool

HasCompleted checks if waiting list is empty

func (*AckRecorder) Size

func (ar *AckRecorder) Size() int

Size returns size

type ActorProxy

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

ActorProxy is proxy that captures messages sent to Parent() under test

func NewActorProxy

func NewActorProxy(root actor.SpawnerContext, underlyingProps *actor.Props, customHandler func(ctx actor.Context)) *ActorProxy

NewActorProxy returns a new instance

func (*ActorProxy) ProxyPID

func (proxy *ActorProxy) ProxyPID() *actor.PID

ProxyPID returns pid of proxy

func (*ActorProxy) Send

func (proxy *ActorProxy) Send(ctx actor.SenderContext, req proto.Message)

Send sends a request via proxy

func (*ActorProxy) SendAndAwait

func (proxy *ActorProxy) SendAndAwait(ctx actor.SenderContext, req proto.Message, resEmpty proto.Message, timeout time.Duration) (proto.Message, error)

SendAndAwait sends a request to underlying actor and wait for response

func (*ActorProxy) Underlying

func (proxy *ActorProxy) Underlying() *actor.PID

Underlying returns PID under the test

type ActorUtil

type ActorUtil struct {
	Logger *logrus.Logger
}

ActorUtil is utility for actor

func (*ActorUtil) Fail

func (u *ActorUtil) Fail(ctx actor.Context, err error)

Fail crashes actor

func (*ActorUtil) IsSystemMessage

func (u *ActorUtil) IsSystemMessage(m interface{}) bool

IsSystemMessage returns if message is SystemMessage

func (*ActorUtil) LogDebug

func (u *ActorUtil) LogDebug(ctx actor.Context, msg string)

LogDebug logs debug level message

func (*ActorUtil) LogError

func (u *ActorUtil) LogError(ctx actor.Context, msg string)

LogError logs error level message

func (*ActorUtil) LogInfo

func (u *ActorUtil) LogInfo(ctx actor.Context, msg string)

LogInfo logs info level message

func (*ActorUtil) LogWarn

func (u *ActorUtil) LogWarn(ctx actor.Context, msg string)

LogWarn logs warn level message

Jump to

Keyboard shortcuts

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