Documentation ¶
Overview ¶
Package mock_telegram is a generated GoMock package.
Package mock_telegram is a generated GoMock package.
Index ¶
- func CustomClaimFactory() jwt.Claims
- func Escape(request string) string
- func MakeHandler(service Service, logger kitlog.Logger, ml machineLearning.Service) http.Handler
- type Command
- type Commandlet
- type CustomClaims
- type MockService
- func (m *MockService) EXPECT() *MockServiceMockRecorder
- func (m *MockService) RegisterCommand(arg0 Command)
- func (m *MockService) RegisterCommandLet(arg0 Commandlet)
- func (m *MockService) SendDocumentToGroup(arg0 context.Context, arg1 []byte, arg2 string, arg3 int64) error
- func (m *MockService) SendImageToGroup(arg0 context.Context, arg1 []byte, arg2 int64) error
- func (m *MockService) SendKeyboard(arg0 context.Context, arg1 []string, arg2 string, arg3 int64) (int, error)
- func (m *MockService) SendMessage(arg0 context.Context, arg1 int64, arg2 string, arg3 int) (int, error)
- func (m *MockService) SendMessagePlainText(arg0 context.Context, arg1 int64, arg2 string, arg3 int) (int, error)
- func (m *MockService) SendMessageWithCorrelation(arg0 context.Context, arg1 int64, arg2 string, arg3 int, arg4 string) (int, error)
- type MockServiceMockRecorder
- func (mr *MockServiceMockRecorder) RegisterCommand(arg0 interface{}) *gomock.Call
- func (mr *MockServiceMockRecorder) RegisterCommandLet(arg0 interface{}) *gomock.Call
- func (mr *MockServiceMockRecorder) SendDocumentToGroup(arg0, arg1, arg2, arg3 interface{}) *gomock.Call
- func (mr *MockServiceMockRecorder) SendImageToGroup(arg0, arg1, arg2 interface{}) *gomock.Call
- func (mr *MockServiceMockRecorder) SendKeyboard(arg0, arg1, arg2, arg3 interface{}) *gomock.Call
- func (mr *MockServiceMockRecorder) SendMessage(arg0, arg1, arg2, arg3 interface{}) *gomock.Call
- func (mr *MockServiceMockRecorder) SendMessagePlainText(arg0, arg1, arg2, arg3 interface{}) *gomock.Call
- func (mr *MockServiceMockRecorder) SendMessageWithCorrelation(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call
- type MockStore
- func (m *MockStore) AcknowledgeReply(id bson.ObjectId) error
- func (m *MockStore) EXPECT() *MockStoreMockRecorder
- func (m *MockStore) GetReplies(chat int64) ([]Replies, error)
- func (m *MockStore) GetRoomKey(chat uint32) (int64, error)
- func (m *MockStore) GetUUID(chat int64, name string) (uint32, error)
- func (m *MockStore) SaveReply(chat int64, message, correlationId string) error
- func (m *MockStore) SetState(user int, chat int64, state string, field []string) error
- type MockStoreMockRecorder
- func (mr *MockStoreMockRecorder) AcknowledgeReply(id interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) GetReplies(chat interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) GetRoomKey(chat interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) GetUUID(chat, name interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) SaveReply(chat, message, correlationId interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) SetState(user, chat, state, field interface{}) *gomock.Call
- type RemoteCommand
- type Replies
- type Service
- func NewInstrumentService(counter metrics.Counter, errorCount metrics.Counter, latency metrics.Histogram, ...) Service
- func NewLoggingService(logger log.Logger, s Service) Service
- func NewMachineLearning(service machineLearning.Service, s Service) Service
- func NewService(store Store, authService auth.Service) Service
- type State
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CustomClaimFactory ¶
func CustomClaimFactory() jwt.Claims
func MakeHandler ¶
MakeHandler returns a HTTP Restul endpoint to handle user requests
Types ¶
type Command ¶
type Command interface { CommandIdentifier() string CommandDescription() string RestrictToAuthorised() bool Show(chat uint32) bool Execute(ctx context.Context, update tgbotapi.Update) }
func NewHelpCommand ¶
func NewIDCommand ¶
func NewTokenCommand ¶
type Commandlet ¶
type Commandlet interface { CanExecute(update tgbotapi.Update, state State) bool Execute(ctx context.Context, update tgbotapi.Update, state State) NextState(update tgbotapi.Update, state State) string Fields(update tgbotapi.Update, state State) []string }
func NewTelegramAuthApprovalCommand ¶
func NewTelegramAuthApprovalCommand(service2 Service, store Store) Commandlet
type CustomClaims ¶
type CustomClaims struct { RoomToken uint32 `json:"roomToken"` jwt.StandardClaims }
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) EXPECT ¶
func (m *MockService) EXPECT() *MockServiceMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockService) RegisterCommand ¶
func (m *MockService) RegisterCommand(arg0 Command)
RegisterCommand mocks base method
func (*MockService) RegisterCommandLet ¶
func (m *MockService) RegisterCommandLet(arg0 Commandlet)
RegisterCommandLet mocks base method
func (*MockService) SendDocumentToGroup ¶
func (m *MockService) SendDocumentToGroup(arg0 context.Context, arg1 []byte, arg2 string, arg3 int64) error
SendDocumentToGroup mocks base method
func (*MockService) SendImageToGroup ¶
SendImageToGroup mocks base method
func (*MockService) SendKeyboard ¶
func (m *MockService) SendKeyboard(arg0 context.Context, arg1 []string, arg2 string, arg3 int64) (int, error)
SendKeyboard mocks base method
func (*MockService) SendMessage ¶
func (m *MockService) SendMessage(arg0 context.Context, arg1 int64, arg2 string, arg3 int) (int, error)
SendMessage mocks base method
func (*MockService) SendMessagePlainText ¶
func (m *MockService) SendMessagePlainText(arg0 context.Context, arg1 int64, arg2 string, arg3 int) (int, error)
SendMessagePlainText mocks base method
type MockServiceMockRecorder ¶
type MockServiceMockRecorder struct {
// contains filtered or unexported fields
}
MockServiceMockRecorder is the mock recorder for MockService
func (*MockServiceMockRecorder) RegisterCommand ¶
func (mr *MockServiceMockRecorder) RegisterCommand(arg0 interface{}) *gomock.Call
RegisterCommand indicates an expected call of RegisterCommand
func (*MockServiceMockRecorder) RegisterCommandLet ¶
func (mr *MockServiceMockRecorder) RegisterCommandLet(arg0 interface{}) *gomock.Call
RegisterCommandLet indicates an expected call of RegisterCommandLet
func (*MockServiceMockRecorder) SendDocumentToGroup ¶
func (mr *MockServiceMockRecorder) SendDocumentToGroup(arg0, arg1, arg2, arg3 interface{}) *gomock.Call
SendDocumentToGroup indicates an expected call of SendDocumentToGroup
func (*MockServiceMockRecorder) SendImageToGroup ¶
func (mr *MockServiceMockRecorder) SendImageToGroup(arg0, arg1, arg2 interface{}) *gomock.Call
SendImageToGroup indicates an expected call of SendImageToGroup
func (*MockServiceMockRecorder) SendKeyboard ¶
func (mr *MockServiceMockRecorder) SendKeyboard(arg0, arg1, arg2, arg3 interface{}) *gomock.Call
SendKeyboard indicates an expected call of SendKeyboard
func (*MockServiceMockRecorder) SendMessage ¶
func (mr *MockServiceMockRecorder) SendMessage(arg0, arg1, arg2, arg3 interface{}) *gomock.Call
SendMessage indicates an expected call of SendMessage
func (*MockServiceMockRecorder) SendMessagePlainText ¶
func (mr *MockServiceMockRecorder) SendMessagePlainText(arg0, arg1, arg2, arg3 interface{}) *gomock.Call
SendMessagePlainText indicates an expected call of SendMessagePlainText
func (*MockServiceMockRecorder) SendMessageWithCorrelation ¶
func (mr *MockServiceMockRecorder) SendMessageWithCorrelation(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call
SendMessageWithCorrelation indicates an expected call of SendMessageWithCorrelation
type MockStore ¶
type MockStore struct {
// contains filtered or unexported fields
}
MockStore is a mock of Store interface
func NewMockStore ¶
func NewMockStore(ctrl *gomock.Controller) *MockStore
NewMockStore creates a new mock instance
func (*MockStore) AcknowledgeReply ¶
AcknowledgeReply mocks base method
func (*MockStore) EXPECT ¶
func (m *MockStore) EXPECT() *MockStoreMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockStore) GetReplies ¶
GetReplies mocks base method
func (*MockStore) GetRoomKey ¶
GetRoomKey mocks base method
type MockStoreMockRecorder ¶
type MockStoreMockRecorder struct {
// contains filtered or unexported fields
}
MockStoreMockRecorder is the mock recorder for MockStore
func (*MockStoreMockRecorder) AcknowledgeReply ¶
func (mr *MockStoreMockRecorder) AcknowledgeReply(id interface{}) *gomock.Call
AcknowledgeReply indicates an expected call of AcknowledgeReply
func (*MockStoreMockRecorder) GetReplies ¶
func (mr *MockStoreMockRecorder) GetReplies(chat interface{}) *gomock.Call
GetReplies indicates an expected call of GetReplies
func (*MockStoreMockRecorder) GetRoomKey ¶
func (mr *MockStoreMockRecorder) GetRoomKey(chat interface{}) *gomock.Call
GetRoomKey indicates an expected call of GetRoomKey
func (*MockStoreMockRecorder) GetUUID ¶
func (mr *MockStoreMockRecorder) GetUUID(chat, name interface{}) *gomock.Call
GetUUID indicates an expected call of GetUUID
func (*MockStoreMockRecorder) SaveReply ¶
func (mr *MockStoreMockRecorder) SaveReply(chat, message, correlationId interface{}) *gomock.Call
SaveReply indicates an expected call of SaveReply
func (*MockStoreMockRecorder) SetState ¶
func (mr *MockStoreMockRecorder) SetState(user, chat, state, field interface{}) *gomock.Call
SetState indicates an expected call of SetState
type RemoteCommand ¶
type RemoteCommand interface {
GetCommandGroup() uint32
}
type Service ¶
type Service interface { SendMessage(ctx context.Context, chatID int64, message string, messageID int) (msgid int, err error) SendMessageWithCorrelation(ctx context.Context, chatID int64, message string, messageID int, correlationId string) (msgid int, err error) SendMessagePlainText(ctx context.Context, chatID int64, message string, messageID int) (msgid int, err error) SendImageToGroup(ctx context.Context, image []byte, group int64) error SendDocumentToGroup(ctx context.Context, document []byte, extension string, group int64) error SendKeyboard(ctx context.Context, buttons []string, text string, chat int64) (int, error) RegisterCommand(command Command) RegisterCommandLet(commandlet Commandlet) // contains filtered or unexported methods }
func NewInstrumentService ¶
func NewMachineLearning ¶
func NewMachineLearning(service machineLearning.Service, s Service) Service
NewMachineLearning returns a decorated Service object that will log the telegram actions executed to the machine learning database
type Store ¶
type Store interface { SetState(user int, chat int64, state string, field []string) error GetRoomKey(chat uint32) (roomid int64, err error) GetUUID(chat int64, name string) (uuid uint32, err error) SaveReply(chat int64, message string, correlationId string) error GetReplies(chat int64) ([]Replies, error) AcknowledgeReply(id bson.ObjectId) error // contains filtered or unexported methods }
func NewMongoStore ¶
func NewMongoStore(mongo *mgo.Database) Store