Documentation ¶
Index ¶
- Constants
- Variables
- func AddSubscription(user *TGBotAPI.User, chat *TGBotAPI.Chat) (err error)
- func BotCommandRouter(message *TGBotAPI.Message) error
- func BotRouter(next http.Handler) http.Handler
- func BotUpdateHandler(w http.ResponseWriter, req *http.Request)
- func BuildUserStatURL(token string) string
- func ExtractUpdate(next http.Handler) http.HandlerFunc
- func GetChatTags(w http.ResponseWriter, req *http.Request)
- func GetChats(w http.ResponseWriter, req *http.Request)
- func GetImages(w http.ResponseWriter, req *http.Request)
- func GetUserTags(w http.ResponseWriter, req *http.Request)
- func MiddlewareLogin(next http.Handler) http.Handler
- func SetUserToken(userId int) (string, error)
- type ChatsJSON
- type ImagesJSON
- type TagsJSON
- type UserJSON
Constants ¶
View Source
const ( UserStatsURL = "/stats" MaxFailedUpdates = 100 UpdateTimeout = 3 * time.Second CommandType = "command" PictureType = "picture" DocumentType = "doc" )
Variables ¶
View Source
var ( UserKey key = "user" UpdateTypeKey key = "uptype" UpdateKey key = "update" MessageKey key = "message" )
Functions ¶
func AddSubscription ¶
func AddSubscription(user *TGBotAPI.User, chat *TGBotAPI.Chat) (err error)
func BotCommandRouter ¶
func BotCommandRouter(message *TGBotAPI.Message) error
func BotUpdateHandler ¶
func BotUpdateHandler(w http.ResponseWriter, req *http.Request)
func BuildUserStatURL ¶
func ExtractUpdate ¶
func ExtractUpdate(next http.Handler) http.HandlerFunc
func GetChatTags ¶
func GetChatTags(w http.ResponseWriter, req *http.Request)
func GetUserTags ¶
func GetUserTags(w http.ResponseWriter, req *http.Request)
func SetUserToken ¶
Types ¶
type ImagesJSON ¶
type ImagesJSON struct { Err string `json:"error"` ImagesPrefix string `json:"images_prefix, omitempty"` Images []models.Image `json:"images"` }
func (*ImagesJSON) Response ¶
func (ij *ImagesJSON) Response(w http.ResponseWriter, r *http.Request, status int)
Click to show internal directories.
Click to hide internal directories.