package
1.21.0
Repository: https://github.com/ardagan/tchannel-go.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

AssertEcho calls the "echo" endpoint with random data, and asserts that the returned data matches the arguments "echo" was called with.
Batch returns a slice with n broken into batches of size batchSize.
Buckets splits n over the specified number of buckets.
CallEcho calls the "echo" endpoint from the given src to target.
CopyCallFrame copies the relay.CallFrame and returns a FakeCallFrame with corresponding values.
Decrementor returns a function that can be called from multiple goroutines and ensures it will only return true n times.
DefaultOpts will return opts if opts is non-nil, NewOpts otherwise.
DurationArray returns an array with the given durations.
FrameRelay sets up a relay that can modify frames using relayFunc.
GetAcceptCloseHostPort returns a host:port that will accept a connection then immediately close it.
GetClosedHostPort will return a host:port that will refuse connections.
IntrospectJSON returns the introspected state of the channel as a JSON string.
NewClient returns a new TChannel that is not listening.
NewClientChannel creates a TChannel that is not listening.
NewFakeTicker returns a new instance of FakeTicker.
NewIncomingCall creates an incoming call for tests.
NewOpts returns a new ChannelOpts that can be used in a chained fashion.
NewServer returns a new TChannel server that listens on :0.
NewServerChannel creates a TChannel that is listening and returns the channel.
NewStubClock returns a fake wall-clock object.
NewTestServer constructs a TestServer.
Ping sends a ping from src to target.
RandBytes returns n random byte slice that points to a shared random byte array.
RandString returns a random alphanumeric string for testing.
RegisterEcho registers an echo endpoint on the given channel.
RegisterFunc registers a function as a handler for the given method name.
ResetSleepStub resets a Sleep stub.
RunN runs the given f n times (and passes the run's index) and waits till they complete.
SetTimeout is used to fail tests after a timeout.
SleepStub stubs a function variable that points to time.Sleep.
StrArray will return an array with the given strings.
StrMap returns a map where the keys are the given strings.
Timeout returns the timeout multiplied by any set multiplier.
WaitFor will retry f till it returns true for a maximum of timeout.
WaitWG waits for the given WaitGroup to be complete with a timeout and returns whether the WaitGroup completed within the timeout.
WithServer sets up a TChannel that is listening and runs the given function with the channel.
WithTestServer creates a new TestServer, runs the passed function, and then verifies that no resources were leaked.

# Constants

Default service names for the test channels.
Default service names for the test channels.

# Structs

ChannelOpts contains options to create a test channel using WithServer.
FakeCallFrame is a stub implementation of the CallFrame interface.
FakeIncomingCall implements IncomingCall interface.
FakeTicker is a ticker for unit tests that can be controlled deterministically.
LogFilter is a single substring match that can be ignored.
LogVerification contains options to control the log verification.
StubClock is a fake wall-clock, exposing a Now() method that returns a test-controlled time.
A TestServer encapsulates a TChannel server, a client factory, and functions to ensure that we're not leaking resources.

# Interfaces

Decrement is the interface returned by Decrementor.