events

package
v0.3.66-rc-7909614 Latest Latest
Warning

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

Go to latest
Published: May 15, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventClient

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

EventClient is the local struct for retrieving events from the api using the grpc client

func NewEventClient

func NewEventClient(config *client.ApiConnectionDetails) *EventClient

NewEventClient returns a new EventClient

func (*EventClient) Close

func (ec *EventClient) Close()

Close will close the api connection if established

func (*EventClient) GetJobEventMessage

func (ec *EventClient) GetJobEventMessage(ctx context.Context, jobReq *api.JobSetRequest) (api.Event_GetJobSetEventsClient, error)

GetJobEventMessage performs all the steps for obtaining an event message

func (*EventClient) Health

func (ec *EventClient) Health(ctx context.Context, empty *types.Empty) (*api.HealthCheckResponse, error)

type JobEventReader

type JobEventReader interface {
	GetJobEventMessage(ctx context.Context, jobReq *api.JobSetRequest) (api.Event_GetJobSetEventsClient, error)
	Health(ctx context.Context, empty *types.Empty) (*api.HealthCheckResponse, error)
	Close()
}

JobEventReader is the interface for retrieving job set event messages

type JobEventReaderMock

type JobEventReaderMock struct {
	// CloseFunc mocks the Close method.
	CloseFunc func()

	// GetJobEventMessageFunc mocks the GetJobEventMessage method.
	GetJobEventMessageFunc func(ctx context.Context, jobReq *api.JobSetRequest) (api.Event_GetJobSetEventsClient, error)
	// HealthFunc mocks the Health method.
	HealthFunc func(ctx context.Context, empty *types.Empty) (*api.HealthCheckResponse, error)
	// contains filtered or unexported fields
}

JobEventReaderMock is a mock implementation of JobEventReader.

func TestSomethingThatUsesJobEventReader(t *testing.T) {

	// make and configure a mocked JobEventReader
	mockedJobEventReader := &JobEventReaderMock{
		CloseFunc: func()  {
			panic("mock out the Close method")
		},
		GetJobEventMessageFunc: func(ctx context.Context, jobReq *api.JobSetRequest) (*api.EventStreamMessage, error) {
			panic("mock out the GetJobEventMessage method")
		},
		HealthFunc: func(ctx context.Context, empty *types.Empty) (*api.HealthCheckResponse, error) {
			panic("mock out the Health method")
		},
	}

	// use mockedJobEventReader in code that requires JobEventReader
	// and then make assertions.

}

func (*JobEventReaderMock) Close

func (mock *JobEventReaderMock) Close()

Close calls CloseFunc.

func (*JobEventReaderMock) CloseCalls

func (mock *JobEventReaderMock) CloseCalls() []struct {
}

CloseCalls gets all the calls that were made to Close. Check the length with:

len(mockedJobEventReader.CloseCalls())

func (*JobEventReaderMock) GetJobEventMessage

func (mock *JobEventReaderMock) GetJobEventMessage(ctx context.Context, jobReq *api.JobSetRequest) (api.Event_GetJobSetEventsClient, error)

GetJobEventMessage calls GetJobEventMessageFunc.

func (*JobEventReaderMock) GetJobEventMessageCalls

func (mock *JobEventReaderMock) GetJobEventMessageCalls() []struct {
	Ctx    context.Context
	JobReq *api.JobSetRequest
}

GetJobEventMessageCalls gets all the calls that were made to GetJobEventMessage. Check the length with:

len(mockedJobEventReader.GetJobEventMessageCalls())

func (*JobEventReaderMock) Health

func (mock *JobEventReaderMock) Health(ctx context.Context, empty *types.Empty) (*api.HealthCheckResponse, error)

Health calls HealthFunc.

func (*JobEventReaderMock) HealthCalls

func (mock *JobEventReaderMock) HealthCalls() []struct {
	Ctx   context.Context
	Empty *types.Empty
}

HealthCalls gets all the calls that were made to Health. Check the length with:

len(mockedJobEventReader.HealthCalls())

type PooledEventClient added in v0.3.63

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

func NewPooledEventClient added in v0.3.63

func NewPooledEventClient(pool *grpcpool.Pool) *PooledEventClient

func (*PooledEventClient) Close added in v0.3.63

func (ec *PooledEventClient) Close()

func (*PooledEventClient) GetJobEventMessage added in v0.3.63

func (pec *PooledEventClient) GetJobEventMessage(ctx context.Context, jobReq *api.JobSetRequest) (api.Event_GetJobSetEventsClient, error)

GetJobEventMessage performs all the steps for obtaining an event message

func (*PooledEventClient) Health added in v0.3.63

Jump to

Keyboard shortcuts

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