Documentation ¶
Index ¶
- Variables
- func InitGoogleChatMock() appcontext.Component
- func InitMockLogger() appcontext.Component
- func InitSensuMock() appcontext.Component
- func InitSlackMock() appcontext.Component
- func InitTelegramMock() appcontext.Component
- type MockGoogleChatRepository
- type MockLogger
- func (logger MockLogger) DPanic(args ...interface{})
- func (logger MockLogger) DPanicf(template string, args ...interface{})
- func (logger MockLogger) Debug(args ...interface{})
- func (logger MockLogger) Debugf(template string, args ...interface{})
- func (logger MockLogger) Error(args ...interface{})
- func (logger MockLogger) Errorf(template string, args ...interface{})
- func (logger MockLogger) Fatal(args ...interface{})
- func (logger MockLogger) Fatalf(template string, args ...interface{})
- func (logger MockLogger) Info(args ...interface{})
- func (logger MockLogger) Infof(template string, args ...interface{})
- func (logger MockLogger) Panic(args ...interface{})
- func (logger MockLogger) Panicf(template string, args ...interface{})
- func (logger MockLogger) Sync()
- func (logger MockLogger) Warn(args ...interface{})
- func (logger MockLogger) Warnf(template string, args ...interface{})
- type SensuMockRepository
- func (repo SensuMockRepository) SensuDelete(sensuURL string) error
- func (repo SensuMockRepository) SensuGet(sensuurl string) ([]byte, error)
- func (repo SensuMockRepository) SensuHealth(sensuurl string) bool
- func (repo SensuMockRepository) SensuPost(sensuurl string, method string, body []byte) ([]byte, error)
- type SlackMockRepository
- func (repo SlackMockRepository) EphemeralFileMessage(channel string, user string, message string, title string) error
- func (repo SlackMockRepository) EphemeralMessage(channel string, user string, message string) error
- func (repo SlackMockRepository) SendMessage(channel string, message, attach string) error
- func (repo SlackMockRepository) SendMessageWithImage(channel string, message, textImage, imageTitle, imageURL string) error
- type TelegramMockRepository
Constants ¶
This section is empty.
Variables ¶
var ( // SensuCalls int SensuCalls int // SensuPostCalls int SensuPostCalls int // SensuHealthCalls int SensuHealthCalls int // SensuDeleteCalls int SensuDeleteCalls int )
var ( // GoogleChatCalls int GoogleChatCalls int )
var ( // SlackCalls int SlackCalls int )
var ( // TelegramCalls int TelegramCalls int )
Functions ¶
func InitGoogleChatMock ¶
func InitGoogleChatMock() appcontext.Component
InitGoogleChatMock returns a MockGoogleChatRepository interface
func InitMockLogger ¶
func InitMockLogger() appcontext.Component
InitMockLogger func creates a mock logger interface
func InitSensuMock ¶
func InitSensuMock() appcontext.Component
InitSensuMock returns a SensuMockRepository interface
func InitSlackMock ¶
func InitSlackMock() appcontext.Component
InitSlackMock returns a SlackMockRepository interface
func InitTelegramMock ¶
func InitTelegramMock() appcontext.Component
InitTelegramMock returns a TelegramMockRepository interface
Types ¶
type MockGoogleChatRepository ¶
type MockGoogleChatRepository struct { }
MockGoogleChatRepository struct
func (MockGoogleChatRepository) SendMessageGoogleChat ¶
func (repo MockGoogleChatRepository) SendMessageGoogleChat(event *chat.DeprecatedEvent, content string) error
type MockLogger ¶
type MockLogger struct { //Logger only supports structured logging (less features more performance) Logger *zap.Logger //Sugar supports structured and printf-style APIs (less performance more features) Sugar *zap.SugaredLogger }
MockLogger wrapper with two Logger methods
func (MockLogger) DPanic ¶
func (logger MockLogger) DPanic(args ...interface{})
DPanic uses fmt.Sprint to construct and log a message. In development, the logger then panics. (See DPanicLevel for details.)
func (MockLogger) DPanicf ¶
func (logger MockLogger) DPanicf(template string, args ...interface{})
DPanicf uses fmt.Sprintf to log a templated message. In development, the logger then panics. (See DPanicLevel for details.)
func (MockLogger) Debug ¶
func (logger MockLogger) Debug(args ...interface{})
Debug uses fmt.Sprint to construct and log a message.
func (MockLogger) Debugf ¶
func (logger MockLogger) Debugf(template string, args ...interface{})
Debugf uses fmt.Sprintf to log a templated message.
func (MockLogger) Error ¶
func (logger MockLogger) Error(args ...interface{})
Error uses fmt.Sprint to construct and log a message.
func (MockLogger) Errorf ¶
func (logger MockLogger) Errorf(template string, args ...interface{})
Errorf uses fmt.Sprintf to log a templated message.
func (MockLogger) Fatal ¶
func (logger MockLogger) Fatal(args ...interface{})
Fatal uses fmt.Sprint to construct and log a message, then calls os.Exit.
func (MockLogger) Fatalf ¶
func (logger MockLogger) Fatalf(template string, args ...interface{})
Fatalf uses fmt.Sprintf to log a templated message, then calls os.Exit.
func (MockLogger) Info ¶
func (logger MockLogger) Info(args ...interface{})
Info uses fmt.Sprint to construct and log a message.
func (MockLogger) Infof ¶
func (logger MockLogger) Infof(template string, args ...interface{})
Infof uses fmt.Sprintf to log a templated message.
func (MockLogger) Panic ¶
func (logger MockLogger) Panic(args ...interface{})
Panic uses fmt.Sprint to construct and log a message, then panics.
func (MockLogger) Panicf ¶
func (logger MockLogger) Panicf(template string, args ...interface{})
Panicf uses fmt.Sprintf to log a templated message, then panics.
func (MockLogger) Warn ¶
func (logger MockLogger) Warn(args ...interface{})
Warn uses fmt.Sprint to construct and log a message.
func (MockLogger) Warnf ¶
func (logger MockLogger) Warnf(template string, args ...interface{})
Warnf uses fmt.Sprintf to log a templated message.
type SensuMockRepository ¶
type SensuMockRepository struct { }
SensuMockRepository struct mock
func (SensuMockRepository) SensuDelete ¶
func (repo SensuMockRepository) SensuDelete(sensuURL string) error
func (SensuMockRepository) SensuGet ¶
func (repo SensuMockRepository) SensuGet(sensuurl string) ([]byte, error)
SensuGet func return []byte and error from a requested URL using a sensu api token
func (SensuMockRepository) SensuHealth ¶
func (repo SensuMockRepository) SensuHealth(sensuurl string) bool
SensuHealth func
type SlackMockRepository ¶
type SlackMockRepository struct { }
SlackMockRepository struct mock
func (SlackMockRepository) EphemeralFileMessage ¶
func (repo SlackMockRepository) EphemeralFileMessage(channel string, user string, message string, title string) error
EphemeralFileMessage func send a message with attachment using channelID, userID and textMessage and return an error
func (SlackMockRepository) EphemeralMessage ¶
func (repo SlackMockRepository) EphemeralMessage(channel string, user string, message string) error
EphemeralMessage func send a message using channelID, userID and textMessage and return an error
func (SlackMockRepository) SendMessage ¶
func (repo SlackMockRepository) SendMessage(channel string, message, attach string) error
SendMessage func
func (SlackMockRepository) SendMessageWithImage ¶
func (repo SlackMockRepository) SendMessageWithImage(channel string, message, textImage, imageTitle, imageURL string) error
SendMessageWithImage func
type TelegramMockRepository ¶
type TelegramMockRepository struct { }
TelegramMockRepository struct mock
func (TelegramMockRepository) SendTelegramMessage ¶
func (repo TelegramMockRepository) SendTelegramMessage(reqBody []byte) error
SendTelegramMessage takes a chatID and sends answer to them