alert

package
v0.0.0-...-fb315dc Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2019 License: MIT Imports: 30 Imported by: 17

README

GO2HAL Alert Module

Documentation

Overview

Package mock_alert is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeHandler

func MakeHandler(service Service, logger kitlog.Logger, ml machineLearning.Service) http.Handler

MakeHandler returns a rest http handler to send alerts.

The machine learning service can be set to nil if you do not wish to save the requests.

Types

type MockService

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

MockService is a mock of Service interface

func NewMockService

func NewMockService(ctrl *gomock.Controller) *MockService

NewMockService creates a new mock instance

func (*MockService) DeleteReply

func (m *MockService) DeleteReply(ctx context.Context, chatId uint32, messageId string) error

DeleteReply mocks base method

func (*MockService) EXPECT

func (m *MockService) EXPECT() *MockServiceMockRecorder

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

func (*MockService) GetReplies

func (m *MockService) GetReplies(ctx context.Context, chatId uint32) ([]telegram.Replies, error)

GetReplies mocks base method

func (*MockService) SendAlert

func (m *MockService) SendAlert(ctx context.Context, chatId uint32, message string) error

SendAlert mocks base method

func (*MockService) SendAlertWithReply

func (m *MockService) SendAlertWithReply(ctx context.Context, chatId uint32, message, correlationId string) (int, error)

SendAlertWithReply mocks base method

func (*MockService) SendDocumentToAlertGroup

func (m *MockService) SendDocumentToAlertGroup(ctx context.Context, chatid uint32, document []byte, extension string) error

SendDocumentToAlertGroup mocks base method

func (*MockService) SendError

func (m *MockService) SendError(ctx context.Context, err error) error

SendError mocks base method

func (*MockService) SendErrorImage

func (m *MockService) SendErrorImage(ctx context.Context, image []byte) error

SendErrorImage mocks base method

func (*MockService) SendImageToAlertGroup

func (m *MockService) SendImageToAlertGroup(ctx context.Context, chatid uint32, image []byte) error

SendImageToAlertGroup mocks base method

type MockServiceMockRecorder

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

MockServiceMockRecorder is the mock recorder for MockService

func (*MockServiceMockRecorder) DeleteReply

func (mr *MockServiceMockRecorder) DeleteReply(ctx, chatId, messageId interface{}) *gomock.Call

DeleteReply indicates an expected call of DeleteReply

func (*MockServiceMockRecorder) GetReplies

func (mr *MockServiceMockRecorder) GetReplies(ctx, chatId interface{}) *gomock.Call

GetReplies indicates an expected call of GetReplies

func (*MockServiceMockRecorder) SendAlert

func (mr *MockServiceMockRecorder) SendAlert(ctx, chatId, message interface{}) *gomock.Call

SendAlert indicates an expected call of SendAlert

func (*MockServiceMockRecorder) SendAlertWithReply

func (mr *MockServiceMockRecorder) SendAlertWithReply(ctx, chatId, message, correlationId interface{}) *gomock.Call

SendAlertWithReply indicates an expected call of SendAlertWithReply

func (*MockServiceMockRecorder) SendDocumentToAlertGroup

func (mr *MockServiceMockRecorder) SendDocumentToAlertGroup(ctx, chatid, document, extension interface{}) *gomock.Call

SendDocumentToAlertGroup indicates an expected call of SendDocumentToAlertGroup

func (*MockServiceMockRecorder) SendError

func (mr *MockServiceMockRecorder) SendError(ctx, err interface{}) *gomock.Call

SendError indicates an expected call of SendError

func (*MockServiceMockRecorder) SendErrorImage

func (mr *MockServiceMockRecorder) SendErrorImage(ctx, image interface{}) *gomock.Call

SendErrorImage indicates an expected call of SendErrorImage

func (*MockServiceMockRecorder) SendImageToAlertGroup

func (mr *MockServiceMockRecorder) SendImageToAlertGroup(ctx, chatid, image interface{}) *gomock.Call

SendImageToAlertGroup indicates an expected call of SendImageToAlertGroup

type Reply

type Reply struct {
	MessageId     string
	Message       string
	CorrelationId string
}

type SendReplyAlertMessageRequest

type SendReplyAlertMessageRequest struct {
	Message       string
	CorrelationId string
}

type SendReplyAlertMessageResponse

type SendReplyAlertMessageResponse struct {
	MessageId int
}

type Service

type Service interface {
	SendAlert(ctx context.Context, chatId uint32, message string) error
	SendAlertWithReply(ctx context.Context, chatId uint32, message string, correlationId string) (int, error)
	SendImageToAlertGroup(ctx context.Context, chatid uint32, image []byte) error
	SendDocumentToAlertGroup(ctx context.Context, chatid uint32, document []byte, extension string) error

	SendError(ctx context.Context, err error) error
	SendErrorImage(ctx context.Context, image []byte) error

	GetReplies(ctx context.Context, chatId uint32) ([]telegram.Replies, error)
	DeleteReply(ctx context.Context, chatId uint32, messageId string) error
}

Service interface

func NewInstrumentService

func NewInstrumentService(counter metrics.Counter, errorCount metrics.Counter, latency metrics.Histogram, s Service) Service

func NewLoggingService

func NewLoggingService(logger log.Logger, s Service) Service

func NewService

func NewService(t telegram.Service, store telegram.Store) Service

NewService returns a new Alert Service

Jump to

Keyboard shortcuts

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