Documentation
¶
Overview ¶
Package bot is a generated GoMock package.
Index ¶
- Constants
- Variables
- type AMQPBroker
- type AMQPChannel
- type AMQPConnection
- type Blob
- type DefaultAction
- type Dispatcher
- type Job
- type JobKind
- type MetadataDB
- type MockAMQPChannel
- func (m *MockAMQPChannel) Close() error
- func (m *MockAMQPChannel) Consume(queue, consumer string, autoAck, exclusive, noLocal, noWait bool, ...) (<-chan amqp.Delivery, error)
- func (m *MockAMQPChannel) EXPECT() *MockAMQPChannelMockRecorder
- func (m *MockAMQPChannel) Publish(exchange, key string, mandatory, immediate bool, msg amqp.Publishing) error
- func (m *MockAMQPChannel) QueueDeclare(name string, durable, autoDelete, exclusive, noWait bool, args amqp.Table) (amqp.Queue, error)
- type MockAMQPChannelMockRecorder
- func (mr *MockAMQPChannelMockRecorder) Close() *gomock.Call
- func (mr *MockAMQPChannelMockRecorder) Consume(queue, consumer, autoAck, exclusive, noLocal, noWait, args interface{}) *gomock.Call
- func (mr *MockAMQPChannelMockRecorder) Publish(exchange, key, mandatory, immediate, msg interface{}) *gomock.Call
- func (mr *MockAMQPChannelMockRecorder) QueueDeclare(name, durable, autoDelete, exclusive, noWait, args interface{}) *gomock.Call
- type MockAMQPConnection
- type MockAMQPConnectionMockRecorder
- type MockBlob
- func (m *MockBlob) CreateObject(ctx context.Context, bucket, key string, contents []byte) error
- func (m *MockBlob) DeleteObject(ctx context.Context, bucket, key string) error
- func (m *MockBlob) EXPECT() *MockBlobMockRecorder
- func (m *MockBlob) GetObject(ctx context.Context, bucket, key string) ([]byte, error)
- type MockBlobMockRecorder
- type MockMetadataDB
- type MockMetadataDBMockRecorder
- type MockTelegramSender
- func (m *MockTelegramSender) EXPECT() *MockTelegramSenderMockRecorder
- func (m *MockTelegramSender) Send(c telegram_bot_api.Chattable) (telegram_bot_api.Message, error)
- func (m *MockTelegramSender) UploadFileWithContext(ctx context.Context, endpoint string, params map[string]string, ...) (telegram_bot_api.APIResponse, error)
- type MockTelegramSenderMockRecorder
- type MockYoutubeClient
- type MockYoutubeClientMockRecorder
- type Option
- type Options
- type ParsingAction
- type ParsingCtx
- type Payload
- type TelegramSender
- type YoutubeClient
Constants ¶
const ( QueueFetching = "fetching" QueueUploading = "uploading" )
const ( ParseVideoEvent botstate.EventType = "parse_video" GoToDefaultEvent botstate.EventType = "go_to_default" ParsingVideoState botstate.StateType = "parsing_video" )
const SendingMessageError = "Oops, something went wrong, try sending the link again"
const (
StartCommandText = "start"
)
Variables ¶
var StartCommandMessage = "Hi, this is a bot" + emoji.Robot.String() + " for downloading videos from youtube\n\n" +
"Just send a link to the youtube video and follow the further instructions\n" +
"\n*source code:* [github](https://github.com/robotomize/cribe)"
Functions ¶
This section is empty.
Types ¶
type AMQPBroker ¶
type AMQPBroker struct {
*amqp.Connection
}
func NewAMQPBroker ¶
func NewAMQPBroker(connection *amqp.Connection) *AMQPBroker
func (*AMQPBroker) Chan ¶
func (a *AMQPBroker) Chan() (AMQPChannel, error)
type AMQPChannel ¶
type AMQPChannel interface { Publish(exchange, key string, mandatory, immediate bool, msg amqp.Publishing) error QueueDeclare(name string, durable, autoDelete, exclusive, noWait bool, args amqp.Table) (amqp.Queue, error) Consume(queue, consumer string, autoAck, exclusive, noLocal, noWait bool, args amqp.Table) (<-chan amqp.Delivery, error) Close() error }
type AMQPConnection ¶
type AMQPConnection interface { Chan() (AMQPChannel, error) Close() error }
type DefaultAction ¶
type DefaultAction struct{}
func (*DefaultAction) Execute ¶
func (p *DefaultAction) Execute(_ botstate.EventContext) botstate.EventType
type Dispatcher ¶
type Dispatcher struct { Jobs []Job // contains filtered or unexported fields }
func NewDispatcher ¶
func NewDispatcher(env *srvenv.Env, opts ...Option) (*Dispatcher, error)
type MetadataDB ¶
type MockAMQPChannel ¶
type MockAMQPChannel struct {
// contains filtered or unexported fields
}
MockAMQPChannel is a mock of AMQPChannel interface.
func NewMockAMQPChannel ¶
func NewMockAMQPChannel(ctrl *gomock.Controller) *MockAMQPChannel
NewMockAMQPChannel creates a new mock instance.
func (*MockAMQPChannel) Consume ¶
func (m *MockAMQPChannel) Consume(queue, consumer string, autoAck, exclusive, noLocal, noWait bool, args amqp.Table) (<-chan amqp.Delivery, error)
Consume mocks base method.
func (*MockAMQPChannel) EXPECT ¶
func (m *MockAMQPChannel) EXPECT() *MockAMQPChannelMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockAMQPChannel) Publish ¶
func (m *MockAMQPChannel) Publish(exchange, key string, mandatory, immediate bool, msg amqp.Publishing) error
Publish mocks base method.
func (*MockAMQPChannel) QueueDeclare ¶
func (m *MockAMQPChannel) QueueDeclare(name string, durable, autoDelete, exclusive, noWait bool, args amqp.Table) (amqp.Queue, error)
QueueDeclare mocks base method.
type MockAMQPChannelMockRecorder ¶
type MockAMQPChannelMockRecorder struct {
// contains filtered or unexported fields
}
MockAMQPChannelMockRecorder is the mock recorder for MockAMQPChannel.
func (*MockAMQPChannelMockRecorder) Close ¶
func (mr *MockAMQPChannelMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close.
func (*MockAMQPChannelMockRecorder) Consume ¶
func (mr *MockAMQPChannelMockRecorder) Consume(queue, consumer, autoAck, exclusive, noLocal, noWait, args interface{}) *gomock.Call
Consume indicates an expected call of Consume.
func (*MockAMQPChannelMockRecorder) Publish ¶
func (mr *MockAMQPChannelMockRecorder) Publish(exchange, key, mandatory, immediate, msg interface{}) *gomock.Call
Publish indicates an expected call of Publish.
func (*MockAMQPChannelMockRecorder) QueueDeclare ¶
func (mr *MockAMQPChannelMockRecorder) QueueDeclare(name, durable, autoDelete, exclusive, noWait, args interface{}) *gomock.Call
QueueDeclare indicates an expected call of QueueDeclare.
type MockAMQPConnection ¶
type MockAMQPConnection struct {
// contains filtered or unexported fields
}
MockAMQPConnection is a mock of AMQPConnection interface.
func NewMockAMQPConnection ¶
func NewMockAMQPConnection(ctrl *gomock.Controller) *MockAMQPConnection
NewMockAMQPConnection creates a new mock instance.
func (*MockAMQPConnection) Chan ¶
func (m *MockAMQPConnection) Chan() (AMQPChannel, error)
Chan mocks base method.
func (*MockAMQPConnection) Close ¶
func (m *MockAMQPConnection) Close() error
Close mocks base method.
func (*MockAMQPConnection) EXPECT ¶
func (m *MockAMQPConnection) EXPECT() *MockAMQPConnectionMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockAMQPConnectionMockRecorder ¶
type MockAMQPConnectionMockRecorder struct {
// contains filtered or unexported fields
}
MockAMQPConnectionMockRecorder is the mock recorder for MockAMQPConnection.
func (*MockAMQPConnectionMockRecorder) Chan ¶
func (mr *MockAMQPConnectionMockRecorder) Chan() *gomock.Call
Chan indicates an expected call of Chan.
func (*MockAMQPConnectionMockRecorder) Close ¶
func (mr *MockAMQPConnectionMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close.
type MockBlob ¶
type MockBlob struct {
// contains filtered or unexported fields
}
MockBlob is a mock of Blob interface.
func NewMockBlob ¶
func NewMockBlob(ctrl *gomock.Controller) *MockBlob
NewMockBlob creates a new mock instance.
func (*MockBlob) CreateObject ¶
CreateObject mocks base method.
func (*MockBlob) DeleteObject ¶
DeleteObject mocks base method.
func (*MockBlob) EXPECT ¶
func (m *MockBlob) EXPECT() *MockBlobMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockBlobMockRecorder ¶
type MockBlobMockRecorder struct {
// contains filtered or unexported fields
}
MockBlobMockRecorder is the mock recorder for MockBlob.
func (*MockBlobMockRecorder) CreateObject ¶
func (mr *MockBlobMockRecorder) CreateObject(ctx, bucket, key, contents interface{}) *gomock.Call
CreateObject indicates an expected call of CreateObject.
func (*MockBlobMockRecorder) DeleteObject ¶
func (mr *MockBlobMockRecorder) DeleteObject(ctx, bucket, key interface{}) *gomock.Call
DeleteObject indicates an expected call of DeleteObject.
func (*MockBlobMockRecorder) GetObject ¶
func (mr *MockBlobMockRecorder) GetObject(ctx, bucket, key interface{}) *gomock.Call
GetObject indicates an expected call of GetObject.
type MockMetadataDB ¶
type MockMetadataDB struct {
// contains filtered or unexported fields
}
MockMetadataDB is a mock of MetadataDB interface.
func NewMockMetadataDB ¶
func NewMockMetadataDB(ctrl *gomock.Controller) *MockMetadataDB
NewMockMetadataDB creates a new mock instance.
func (*MockMetadataDB) EXPECT ¶
func (m *MockMetadataDB) EXPECT() *MockMetadataDBMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockMetadataDB) FetchByMetadata ¶
func (m *MockMetadataDB) FetchByMetadata(ctx context.Context, videoID, mime, quality string) (db.Metadata, error)
FetchByMetadata mocks base method.
type MockMetadataDBMockRecorder ¶
type MockMetadataDBMockRecorder struct {
// contains filtered or unexported fields
}
MockMetadataDBMockRecorder is the mock recorder for MockMetadataDB.
func (*MockMetadataDBMockRecorder) FetchByMetadata ¶
func (mr *MockMetadataDBMockRecorder) FetchByMetadata(ctx, videoID, mime, quality interface{}) *gomock.Call
FetchByMetadata indicates an expected call of FetchByMetadata.
func (*MockMetadataDBMockRecorder) Save ¶
func (mr *MockMetadataDBMockRecorder) Save(ctx, model interface{}) *gomock.Call
Save indicates an expected call of Save.
type MockTelegramSender ¶
type MockTelegramSender struct {
// contains filtered or unexported fields
}
MockTelegramSender is a mock of TelegramSender interface.
func NewMockTelegramSender ¶
func NewMockTelegramSender(ctrl *gomock.Controller) *MockTelegramSender
NewMockTelegramSender creates a new mock instance.
func (*MockTelegramSender) EXPECT ¶
func (m *MockTelegramSender) EXPECT() *MockTelegramSenderMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockTelegramSender) Send ¶
func (m *MockTelegramSender) Send(c telegram_bot_api.Chattable) (telegram_bot_api.Message, error)
Send mocks base method.
func (*MockTelegramSender) UploadFileWithContext ¶
func (m *MockTelegramSender) UploadFileWithContext(ctx context.Context, endpoint string, params map[string]string, fieldname string, file interface{}) (telegram_bot_api.APIResponse, error)
UploadFileWithContext mocks base method.
type MockTelegramSenderMockRecorder ¶
type MockTelegramSenderMockRecorder struct {
// contains filtered or unexported fields
}
MockTelegramSenderMockRecorder is the mock recorder for MockTelegramSender.
func (*MockTelegramSenderMockRecorder) Send ¶
func (mr *MockTelegramSenderMockRecorder) Send(c interface{}) *gomock.Call
Send indicates an expected call of Send.
func (*MockTelegramSenderMockRecorder) UploadFileWithContext ¶
func (mr *MockTelegramSenderMockRecorder) UploadFileWithContext(ctx, endpoint, params, fieldname, file interface{}) *gomock.Call
UploadFileWithContext indicates an expected call of UploadFileWithContext.
type MockYoutubeClient ¶
type MockYoutubeClient struct {
// contains filtered or unexported fields
}
MockYoutubeClient is a mock of YoutubeClient interface.
func NewMockYoutubeClient ¶
func NewMockYoutubeClient(ctrl *gomock.Controller) *MockYoutubeClient
NewMockYoutubeClient creates a new mock instance.
func (*MockYoutubeClient) EXPECT ¶
func (m *MockYoutubeClient) EXPECT() *MockYoutubeClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockYoutubeClient) GetStreamContext ¶
func (m *MockYoutubeClient) GetStreamContext(ctx context.Context, video *v2.Video, format *v2.Format) (io.ReadCloser, int64, error)
GetStreamContext mocks base method.
func (*MockYoutubeClient) GetVideoContext ¶
GetVideoContext mocks base method.
type MockYoutubeClientMockRecorder ¶
type MockYoutubeClientMockRecorder struct {
// contains filtered or unexported fields
}
MockYoutubeClientMockRecorder is the mock recorder for MockYoutubeClient.
func (*MockYoutubeClientMockRecorder) GetStreamContext ¶
func (mr *MockYoutubeClientMockRecorder) GetStreamContext(ctx, video, format interface{}) *gomock.Call
GetStreamContext indicates an expected call of GetStreamContext.
func (*MockYoutubeClientMockRecorder) GetVideoContext ¶
func (mr *MockYoutubeClientMockRecorder) GetVideoContext(ctx, url interface{}) *gomock.Call
GetVideoContext indicates an expected call of GetVideoContext.
type Option ¶
type Option func(*Dispatcher)
type ParsingAction ¶
type ParsingAction struct{}
func (*ParsingAction) Execute ¶
func (p *ParsingAction) Execute(eventCtx botstate.EventContext) botstate.EventType
type ParsingCtx ¶
type ParsingCtx struct {
// contains filtered or unexported fields
}