events

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package events is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Api

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

func NewApi

func NewApi(handler Handler, log logrus.FieldLogger) *Api

func (*Api) ListEvents

func (a *Api) ListEvents(ctx context.Context, params events.ListEventsParams) middleware.Responder

type Event

type Event struct {
	gorm.Model
	models.Event
}

type Events

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

func New

func New(db *gorm.DB, log logrus.FieldLogger) *Events

func (*Events) AddEvent

func (e *Events) AddEvent(ctx context.Context, entityID string, severity string, msg string, eventTime time.Time, otherEntities ...string)

func (Events) GetEvents

func (e Events) GetEvents(entityID string) ([]*Event, error)

type Handler

type Handler interface {
	// AddEvents and an event for and entityID.
	// Since events, might relate to multiple entities, for example:
	//     host added to cluster, we have the host-id as the main entityID and
	//     the cluster-id as another ID that this event should be related to
	// otherEntities arguments provides for specifying mor IDs that are relevant for this event
	AddEvent(ctx context.Context, entityID string, severity string, msg string, eventTime time.Time, otherEntities ...string)
	GetEvents(entityID string) ([]*Event, error)
}

type MockHandler

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

MockHandler is a mock of Handler interface

func NewMockHandler

func NewMockHandler(ctrl *gomock.Controller) *MockHandler

NewMockHandler creates a new mock instance

func (*MockHandler) AddEvent

func (m *MockHandler) AddEvent(ctx context.Context, entityID, severity, msg string, eventTime time.Time, otherEntities ...string)

AddEvent mocks base method

func (*MockHandler) EXPECT

func (m *MockHandler) EXPECT() *MockHandlerMockRecorder

EXPECT returns an object that allows the caller to indicate expected use

func (*MockHandler) GetEvents

func (m *MockHandler) GetEvents(entityID string) ([]*Event, error)

GetEvents mocks base method

type MockHandlerMockRecorder

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

MockHandlerMockRecorder is the mock recorder for MockHandler

func (*MockHandlerMockRecorder) AddEvent

func (mr *MockHandlerMockRecorder) AddEvent(ctx, entityID, severity, msg, eventTime interface{}, otherEntities ...interface{}) *gomock.Call

AddEvent indicates an expected call of AddEvent

func (*MockHandlerMockRecorder) GetEvents

func (mr *MockHandlerMockRecorder) GetEvents(entityID interface{}) *gomock.Call

GetEvents indicates an expected call of GetEvents

Jump to

Keyboard shortcuts

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