Documentation ¶
Index ¶
- func NewTelegramEventHandler(log logger.Logger, bot *tgbotapi.BotAPI) mediator.EventHandler
- func NewWechatEventHandler(log logger.Logger, wechat *officialaccount.OfficialAccount) mediator.EventHandler
- type Application
- func (app *Application) End(ctx context.Context, log logger.Logger, f domain.From)
- func (app *Application) Get(ctx context.Context, log logger.Logger, f domain.From) (*Chat, error)
- func (app *Application) GetByChatID(ctx context.Context, log logger.Logger, cid string) (*Chat, error)
- func (app *Application) NewChat(ctx context.Context, log logger.Logger, f domain.From) error
- func (app *Application) Prompt(ctx context.Context, log logger.Logger, f domain.From, q string, ...) error
- type Chat
- type Converstaion
- type TelegramEventHandler
- type WechatEventHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTelegramEventHandler ¶
func NewWechatEventHandler ¶ added in v0.2.0
func NewWechatEventHandler(log logger.Logger, wechat *officialaccount.OfficialAccount) mediator.EventHandler
Types ¶
type Application ¶
type Application struct {
// contains filtered or unexported fields
}
func NewApplication ¶
func NewApplication(repo domain.Repository, mediator mediator.Mediator, api domain.ChatGTPService) *Application
func (*Application) GetByChatID ¶ added in v0.1.3
type Chat ¶ added in v0.1.1
type Chat struct { ID string `json:"id"` Channel int `json:"channel"` ChannelUserID string `json:"channel_user_id"` Current *Converstaion `json:"current,omitempty"` Previous []*Converstaion `json:"previous,omitempty"` }
func AssembleEntidy ¶ added in v0.1.2
type Converstaion ¶ added in v0.1.1
type TelegramEventHandler ¶
type TelegramEventHandler struct {
// contains filtered or unexported fields
}
func (*TelegramEventHandler) Handle ¶
func (ev *TelegramEventHandler) Handle(ctx context.Context, event mediator.Event)
func (*TelegramEventHandler) Listening ¶
func (ev *TelegramEventHandler) Listening() []mediator.EventKind
type WechatEventHandler ¶ added in v0.2.0
type WechatEventHandler struct {
// contains filtered or unexported fields
}
func (*WechatEventHandler) Handle ¶ added in v0.2.0
func (w *WechatEventHandler) Handle(ctx context.Context, ev mediator.Event)
func (*WechatEventHandler) Listening ¶ added in v0.2.0
func (w *WechatEventHandler) Listening() []mediator.EventKind
Click to show internal directories.
Click to hide internal directories.