adapters

package
v0.0.0-...-fe336e1 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const FEBRUARY_28TH_YEAR_DAY = 59

Variables

This section is empty.

Functions

This section is empty.

Types

type PostgresRepositoryAdapter

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

func NewSqlRepositoryAdapter

func NewSqlRepositoryAdapter(database *pgxpool.Pool, clock *common.SystemClock) *PostgresRepositoryAdapter

func (*PostgresRepositoryAdapter) DeleteAllChatBirthdays

func (adapter *PostgresRepositoryAdapter) DeleteAllChatBirthdays(ctx context.Context, chatId int64) error

func (*PostgresRepositoryAdapter) DeleteAllUserBirthdays

func (adapter *PostgresRepositoryAdapter) DeleteAllUserBirthdays(ctx context.Context, userId int64) error

func (*PostgresRepositoryAdapter) DeleteBirthday

func (adapter *PostgresRepositoryAdapter) DeleteBirthday(ctx context.Context, chatId int64, userId int64) error

func (*PostgresRepositoryAdapter) GetBirthdayDate

func (adapter *PostgresRepositoryAdapter) GetBirthdayDate(ctx context.Context, chatId int64, userId int64) (*time.Time, error)

func (*PostgresRepositoryAdapter) GetBirthdaysForDate

func (adapter *PostgresRepositoryAdapter) GetBirthdaysForDate(ctx context.Context, date time.Time) ([]birthday_bot.Birthday, error)

func (*PostgresRepositoryAdapter) GetNextBirthdays

func (adapter *PostgresRepositoryAdapter) GetNextBirthdays(ctx context.Context, chatId int64) ([]birthday_bot.Birthday, error)

func (*PostgresRepositoryAdapter) SaveBirthday

func (adapter *PostgresRepositoryAdapter) SaveBirthday(ctx context.Context, birthday birthday_bot.Birthday) error

type TelegramBotWrapper

type TelegramBotWrapper struct {
	BotId int64
	// contains filtered or unexported fields
}

func NewTelegramWrapper

func NewTelegramWrapper(ctx context.Context, bot *telegram.Bot) *TelegramBotWrapper

func (*TelegramBotWrapper) SendMessage

func (wrapper *TelegramBotWrapper) SendMessage(ctx context.Context, chatId int64, text string) error

func (*TelegramBotWrapper) SendReaction

func (wrapper *TelegramBotWrapper) SendReaction(ctx context.Context, chatId int64, messageId int, reaction string) error

func (*TelegramBotWrapper) SendReply

func (wrapper *TelegramBotWrapper) SendReply(ctx context.Context, chatId int64, messageId int, text string) error

Jump to

Keyboard shortcuts

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