testutils

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BrokerProviderMock

type BrokerProviderMock struct {
	InitCalled        bool
	PublishCalled     bool
	PublishCallArgs   *PublishCallArgs
	SubscribeCalled   bool
	SubscribeCallArgs *SubscribeCallArgs
}

func (*BrokerProviderMock) GracefulStop

func (p *BrokerProviderMock) GracefulStop(ctx context.Context) error

func (*BrokerProviderMock) Init

func (p *BrokerProviderMock) Init(opts *broker.InitOptions)

func (*BrokerProviderMock) Publish

func (p *BrokerProviderMock) Publish(ctx context.Context, topic string, msg *broker.Message) error

func (*BrokerProviderMock) Subscribe

func (p *BrokerProviderMock) Subscribe(ctx context.Context, topic string, handler broker.SubscribeHandler) error

type EngineMock

type EngineMock struct {
	InitCalled     bool
	RenderCalled   bool
	RenderCallArgs *EngineMockRenderCallArgs
}

func (*EngineMock) Init

func (e *EngineMock) Init() error

func (*EngineMock) Render

func (e *EngineMock) Render(w http.ResponseWriter, status int, template string, data *sync.Map) error

type EngineMockRenderCallArgs

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

type PublishCallArgs

type PublishCallArgs struct {
	Ctx   context.Context
	Topic string
	Msg   *broker.Message
}

type ResponseMock

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

func NewResponseMock

func NewResponseMock(t *testing.T) *ResponseMock

func (*ResponseMock) Assert

func (r *ResponseMock) Assert(status int, body string)

func (*ResponseMock) Header

func (r *ResponseMock) Header() http.Header

func (*ResponseMock) Write

func (r *ResponseMock) Write(body []byte) (int, error)

func (*ResponseMock) WriteHeader

func (r *ResponseMock) WriteHeader(status int)

type SubscribeCallArgs

type SubscribeCallArgs struct {
	Ctx     context.Context
	Topic   string
	Handler broker.SubscribeHandler
}

Jump to

Keyboard shortcuts

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