adapter

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2022 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPostgresConnPool

func NewPostgresConnPool() (*sql.DB, error)

Types

type ChannelMessageModel

type ChannelMessageModel struct {
	ID        string `json:"id"`
	ChannelID string `json:"channel_id"`
}

type MemoryChannelRepository

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

func NewMemoryChannelRepository

func NewMemoryChannelRepository() *MemoryChannelRepository

func (*MemoryChannelRepository) GetChannelsByHashtags

func (m *MemoryChannelRepository) GetChannelsByHashtags(ctx context.Context, hashtags []string) ([]domain.Channel, error)

func (*MemoryChannelRepository) Save

type PostgresChannelRepository

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

func NewPostgresChannelRepository

func NewPostgresChannelRepository(conn *sql.DB) *PostgresChannelRepository

func (*PostgresChannelRepository) DeleteAll

func (r *PostgresChannelRepository) DeleteAll(ctx context.Context) error

func (*PostgresChannelRepository) GetChannelsByHashtags

func (r *PostgresChannelRepository) GetChannelsByHashtags(ctx context.Context, hashtags []string) ([]domain.Channel, error)

func (*PostgresChannelRepository) Save

type PostgresMessageRepository

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

func NewPostgresMessageRepository

func NewPostgresMessageRepository(conn *sql.DB) *PostgresMessageRepository

func (*PostgresMessageRepository) GetByID

func (p *PostgresMessageRepository) GetByID(ctx context.Context, messageID string) (domain.Message, error)

func (*PostgresMessageRepository) Save

type TgMessageSender

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

func NewMessageSender

func NewMessageSender(tgBot *tgbotapi.BotAPI) *TgMessageSender

func (*TgMessageSender) SendMessageToTgChan

func (t *TgMessageSender) SendMessageToTgChan(tgChanId string, text string, username string, originMessageId string, tgFile domain.TgFile) (domain.ChannelMessage, error)

Jump to

Keyboard shortcuts

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