application

package
v0.0.0-...-05caa3f Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HistoryRepository

type HistoryRepository interface {
	GetPrayerMessageID(ctx context.Context, chatID int) (int, error)
	StorePrayerMessageID(ctx context.Context, chatID int, messageID int) error
}

type LanguageRepository

type LanguageRepository interface {
	GetLang(ctx context.Context, chatID int) (string, error)
	SetLang(ctx context.Context, chatID int, lang string) error
}

type Notifier

type Notifier interface {
	PrayerSoon(ctx context.Context, chatIDs []int, prayer string, time string)
	PrayerNow(ctx context.Context, chatIDs []int, prayer string)
	PrayerJummah(ctx context.Context, chatIDs []int, time string)
}

type PrayerRepository

type PrayerRepository interface {
	StorePrayer(ctx context.Context, times *domain.PrayerTime) error
	GetPrayer(ctx context.Context, day time.Time) (*domain.PrayerTime, error)
}

type Scheduler

type Scheduler interface {
	Run(ctx context.Context, notifier Notifier)
}

type ScriptRepository

type ScriptRepository interface {
	StoreScript(ctx context.Context, language string, script *domain.Script) error
	GetScript(ctx context.Context, language string) (*domain.Script, error)
}

type SubscriberRepository

type SubscriberRepository interface {
	StoreSubscriber(ctx context.Context, chatID int) error
	RemoveSubscribe(ctx context.Context, chatID int) error
	GetSubscribers(ctx context.Context) (chatIDs []int, err error)
}

type UseCase

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

func NewUseCase

func NewUseCase(
	ctx context.Context,
	sc Scheduler,
	prayerRepo PrayerRepository,
	scriptRepo ScriptRepository,
	historyRepo HistoryRepository,
	languageRepo LanguageRepository,
	subscriberRepo SubscriberRepository,
) *UseCase

func (*UseCase) Close

func (uc *UseCase) Close()

func (*UseCase) GetLang

func (uc *UseCase) GetLang(ctx context.Context, chatID int) (string, error)

func (*UseCase) GetPrayerMessageID

func (uc *UseCase) GetPrayerMessageID(ctx context.Context, chatDI int) (int, error)

func (*UseCase) GetPrayers

func (uc *UseCase) GetPrayers() (*domain.PrayerTime, error)

func (*UseCase) GetPrayersDate

func (uc *UseCase) GetPrayersDate(day time.Time) (*domain.PrayerTime, error)

func (*UseCase) GetScript

func (uc *UseCase) GetScript(ctx context.Context, language string) (*domain.Script, error)

func (*UseCase) GetSubscribers

func (uc *UseCase) GetSubscribers(ctx context.Context) ([]int, error)

func (*UseCase) SchedulePrayers

func (uc *UseCase) SchedulePrayers(notifier Notifier)

func (*UseCase) SetLang

func (uc *UseCase) SetLang(ctx context.Context, chatID int, lang string) error

func (*UseCase) StorePrayerMessageID

func (uc *UseCase) StorePrayerMessageID(ctx context.Context, chatDI int, messageID int) error

func (*UseCase) Subscribe

func (uc *UseCase) Subscribe(ctx context.Context, chatID int) error

func (*UseCase) Unsubscribe

func (uc *UseCase) Unsubscribe(ctx context.Context, chatID int) error

Jump to

Keyboard shortcuts

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