Documentation
¶
Index ¶
- Variables
- func MarkTelegramChatAsForbidden(c context.Context, botID string, tgChatID int64, dtForbidden time.Time) error
- func MarkViberChatAsForbidden(c context.Context, tgChatID int64, dtForbidden time.Time) error
- type EntityTypeValidator
- type GaeAppUserStore
- type GaeBaseStore
- type GaeBotChatStore
- func (s *GaeBotChatStore) Close(c context.Context) error
- func (s *GaeBotChatStore) GetBotChatEntityByID(c context.Context, botID, botChatID string) (botChatEntity bots.BotChat, err error)
- func (s *GaeBotChatStore) NewBotChatEntity(c context.Context, botID string, botChat bots.WebhookChat, appUserID int64, ...) bots.BotChat
- func (s *GaeBotChatStore) SaveBotChat(c context.Context, botID, botChatID string, chatEntity bots.BotChat) error
- type GaeBotHost
- type GaeBotUserStore
- func (s GaeBotUserStore) CreateBotUser(c context.Context, botID string, apiUser bots.WebhookActor) (bots.BotUser, error)
- func (s GaeBotUserStore) GetBotUserByID(c context.Context, botUserID interface{}) (bots.BotUser, error)
- func (s GaeBotUserStore) SaveBotUser(c context.Context, botUserID interface{}, userEntity bots.BotUser) error
- type GaeFbmChatStore
- type GaeTelegramChatStore
- type TelegramChatInstanceEntityGae
Constants ¶
This section is empty.
Variables ¶
var GaeLogger = (log.Logger)(logger{}) // TODO: move outside of bots framework
GaeLogger is a logger for GAE environment
Functions ¶
Types ¶
type EntityTypeValidator ¶
type EntityTypeValidator interface { }
EntityTypeValidator validate entity types
type GaeAppUserStore ¶
type GaeAppUserStore struct { GaeBaseStore // contains filtered or unexported fields }
GaeAppUserStore DAL
func NewGaeAppUserStore ¶
func NewGaeAppUserStore(appUserEntityKind string, appUserEntityType reflect.Type, newUserEntity func() bots.BotAppUser) GaeAppUserStore
NewGaeAppUserStore created new DAL
func (GaeAppUserStore) CreateAppUser ¶
func (s GaeAppUserStore) CreateAppUser(c context.Context, botID string, actor bots.WebhookActor) (int64, bots.BotAppUser, error)
CreateAppUser creates app user entity in DB
func (GaeAppUserStore) GetAppUserByID ¶
func (s GaeAppUserStore) GetAppUserByID(c context.Context, appUserID int64, appUser bots.BotAppUser) error
GetAppUserByID returns application user ID
type GaeBaseStore ¶
type GaeBaseStore struct {
// contains filtered or unexported fields
}
GaeBaseStore is base store for GAE
func NewGaeBaseStore ¶
func NewGaeBaseStore(entityKind string) GaeBaseStore
NewGaeBaseStore creates base store for GAE
type GaeBotChatStore ¶
type GaeBotChatStore struct { GaeBaseStore NewBotChatKey func(c context.Context, botID, botChatId string) *datastore.Key // contains filtered or unexported fields }
GaeBotChatStore persists chat to GAE datastore
func (*GaeBotChatStore) Close ¶
func (s *GaeBotChatStore) Close(c context.Context) error
Close is called on request completion
func (*GaeBotChatStore) GetBotChatEntityByID ¶
func (s *GaeBotChatStore) GetBotChatEntityByID(c context.Context, botID, botChatID string) (botChatEntity bots.BotChat, err error)
GetBotChatEntityByID returns bot chat entity by ID
func (*GaeBotChatStore) NewBotChatEntity ¶
func (s *GaeBotChatStore) NewBotChatEntity(c context.Context, botID string, botChat bots.WebhookChat, appUserID int64, botUserID string, isAccessGranted bool) bots.BotChat
NewBotChatEntity creates new bot chat entity
func (*GaeBotChatStore) SaveBotChat ¶
func (s *GaeBotChatStore) SaveBotChat(c context.Context, botID, botChatID string, chatEntity bots.BotChat) error
SaveBotChat saves bot chat
type GaeBotHost ¶
type GaeBotHost struct { }
GaeBotHost represent information on current hosting platform
func (GaeBotHost) Context ¶
func (h GaeBotHost) Context(r *http.Request) context.Context
Context creates context for http.Request
func (GaeBotHost) GetBotCoreStores ¶
func (h GaeBotHost) GetBotCoreStores(platform string, appContext bots.BotAppContext, r *http.Request) (stores bots.BotCoreStores)
GetBotCoreStores returns bot DAL
func (GaeBotHost) GetHTTPClient ¶
func (h GaeBotHost) GetHTTPClient(c context.Context) *http.Client
GetHTTPClient creates an HTTP client using AppEngine's URL fetch
type GaeBotUserStore ¶
type GaeBotUserStore struct { GaeBaseStore // contains filtered or unexported fields }
GaeBotUserStore persist user to GAE datastore
func (GaeBotUserStore) CreateBotUser ¶
func (s GaeBotUserStore) CreateBotUser(c context.Context, botID string, apiUser bots.WebhookActor) (bots.BotUser, error)
CreateBotUser creates bot user
func (GaeBotUserStore) GetBotUserByID ¶
func (s GaeBotUserStore) GetBotUserByID(c context.Context, botUserID interface{}) (bots.BotUser, error)
GetBotUserByID returns bot user by ID
func (GaeBotUserStore) SaveBotUser ¶
func (s GaeBotUserStore) SaveBotUser(c context.Context, botUserID interface{}, userEntity bots.BotUser) error
SaveBotUser saves bot user by ID
type GaeTelegramChatStore ¶
type GaeTelegramChatStore struct {
GaeBotChatStore
}
GaeTelegramChatStore DAL to telegram chat entity
func NewGaeFbmChatStore ¶
func NewGaeFbmChatStore() *GaeTelegramChatStore
NewGaeFbmChatStore creates new DAL for FBM
func NewGaeTelegramChatStore ¶
func NewGaeTelegramChatStore(newTelegramChatEntity func() bots.BotChat) *GaeTelegramChatStore
NewGaeTelegramChatStore creates DAL to Telegram chat entity
type TelegramChatInstanceEntityGae ¶
type TelegramChatInstanceEntityGae struct {
telegram.ChatInstanceEntityBase
}
TelegramChatInstanceEntityGae DAL to Telegram chat entity