go_plan_it

package
v0.0.0-...-607e100 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDB

func NewDB() (*gorm.DB, error)

Types

type App

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

func NewApp

func NewApp(chats *Chats, gpt *gpt.GPT, calendar *calendar.Calendar, logger *slog.Logger, bot *tgbot.Bot) (*App, error)

func (*App) EventToString

func (a *App) EventToString(event *gCalendar.Event) string

func (*App) HandleCalendarWebhook

func (a *App) HandleCalendarWebhook(c *gin.Context)

func (*App) HandleEventsCommand

func (a *App) HandleEventsCommand(c *tgbot.Context)

func (*App) HandleLoginWebhook

func (a *App) HandleLoginWebhook(c *gin.Context)

func (*App) HandleNewEventCommand

func (a *App) HandleNewEventCommand(c *tgbot.Context)

func (*App) HandleNewEventCommandResponse

func (a *App) HandleNewEventCommandResponse(c *tgbot.Context)

func (*App) HandleStartCommand

func (a *App) HandleStartCommand(c *tgbot.Context)

func (*App) HandleStopCommand

func (a *App) HandleStopCommand(c *tgbot.Context)

func (*App) HandleStopWatchCommand

func (a *App) HandleStopWatchCommand(c *tgbot.Context)

func (*App) HandleWatchCommand

func (a *App) HandleWatchCommand(c *tgbot.Context)

func (*App) IsExists

func (a *App) IsExists(c *tgbot.Context)

func (*App) IsRegistered

func (a *App) IsRegistered(c *tgbot.Context)

func (*App) IsSubscribed

func (a *App) IsSubscribed(c *tgbot.Context)

func (*App) SendMorningAgenda

func (a *App) SendMorningAgenda(c *tgbot.Context)

func (*App) SendNotifications

func (a *App) SendNotifications(c *tgbot.Context)

type Chat

type Chat struct {
	ChatId     int64 `gorm:"primaryKey;autoIncrement:false"`
	Registered bool

	ChannelId         *string
	ChannelExpiration *int64
	ChannelResourceId *string
	CalendarId        *string
	NextUpdateAt      *int64
	NextEventId       *string
	Token             *oauth2.Token `gorm:"serializer:json"`

	CreatedAt time.Time
	UpdatedAt time.Time
}

type Chats

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

func NewChats

func NewChats(db *gorm.DB) *Chats

func (*Chats) CreateChat

func (c *Chats) CreateChat(id int64) (*Chat, error)

func (*Chats) DeleteChatById

func (c *Chats) DeleteChatById(id int64) error

func (*Chats) GetActiveChats

func (c *Chats) GetActiveChats() ([]*Chat, error)

func (*Chats) GetChatById

func (c *Chats) GetChatById(id int64) (*Chat, error)

func (*Chats) UpdateChat

func (c *Chats) UpdateChat(chat *Chat) error

Jump to

Keyboard shortcuts

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