Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildHTTPBackends ¶
func BuildHTTPBackends( cfg map[string]interface{}, knownHTTPBackends []string, ) (map[string]*TestHTTPBackend, error)
BuildHTTPBackends returns a map of backends based on config
func BuildTChannelBackends ¶
func BuildTChannelBackends( cfg map[string]interface{}, knownTChannelBackends []string, staticConfig *zanzibar.StaticConfig, tChannelBackends []*TestTChannelBackend, ) (map[string]*TestTChannelBackend, error)
BuildTChannelBackends returns a map of TChannel backends based on config
Types ¶
type TestHTTPBackend ¶
type TestHTTPBackend struct {
Server *zanzibar.HTTPServer
IP string
Port int32
RealPort int32
RealAddr string
WaitGroup *sync.WaitGroup
// contains filtered or unexported fields
}
TestHTTPBackend will pretend to be a http backend
func CreateHTTPBackend ¶
func CreateHTTPBackend(port int32) *TestHTTPBackend
CreateHTTPBackend creates a HTTP backend for testing
func (*TestHTTPBackend) Bootstrap ¶
func (backend *TestHTTPBackend) Bootstrap() error
Bootstrap creates a backend for testing
func (*TestHTTPBackend) HandleFunc ¶
func (backend *TestHTTPBackend) HandleFunc( method string, path string, handler http.HandlerFunc, )
HandleFunc registers funcs
type TestTChannelBackend ¶
type TestTChannelBackend struct {
Channel *tchannel.Channel
Router *zanzibar.TChannelRouter
IP string
Port int32
RealPort int32
RealAddr string
ServiceName string
}
TestTChannelBackend will pretend to be a tchannel backend
func CreateTChannelBackend ¶
func CreateTChannelBackend(port int32, serviceName string) (*TestTChannelBackend, error)
CreateTChannelBackend creates a TChannel backend for testing "serviceName" is the service discovery name, not necessarily same as the thrift service name.
func (*TestTChannelBackend) Bootstrap ¶
func (backend *TestTChannelBackend) Bootstrap() error
Bootstrap creates a backend for testing
func (*TestTChannelBackend) Close ¶
func (backend *TestTChannelBackend) Close()
Close closes the underlying channel
func (*TestTChannelBackend) Register ¶
func (backend *TestTChannelBackend) Register( endpointID, handlerID, method string, handler zanzibar.TChannelHandler, ) error
Register registers tchannel server handler
Click to show internal directories.
Click to hide internal directories.