tglog

package
v0.0.0-...-9135915 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Animation

type Animation struct {
	FileID   string     `bson:"file_id,omitempty"`
	Width    int        `bson:"width,omitempty"`
	Height   int        `bson:"height,omitempty"`
	Duration time.Time  `bson:"duration,omitempty"`
	Thumb    *PhotoSize `bson:"thumb,omitempty"`
	FileName *string    `bson:"file_name,omitempty"`
	MimeType *string    `bson:"mime_type,omitempty"`
	FileSize *int64     `bson:"file_size,omitempty"`
}

type Audio

type Audio struct {
	FileID    string     `bson:"file_id,omitempty"`
	Duration  time.Time  `bson:"duration,omitempty"`
	Performer *string    `bson:"performer,omitempty"`
	Title     *string    `bson:"title,omitempty"`
	MimeType  *string    `bson:"mime_type,omitempty"`
	FileSize  *int64     `bson:"file_size,omitempty"`
	Thumb     *PhotoSize `bson:"thumb,omitempty"`
}

type CallbackQuery

type CallbackQuery struct {
	ID              string   `bson:"id,omitempty"`
	From            User     `bson:"from,omitempty"`
	Message         *Message `bson:"message,omitempty"`
	InlineMessageID *string  `bson:"inline_message_id,omitempty"`
	ChatInstance    string   `bson:"chat_instance,omitempty"`
	Data            *string  `bson:"data,omitempty"`
	GameShortName   *string  `bson:"game_short_name,omitempty"`
}

type Chat

type Chat struct {
	ID        int64    `bson:"id,omitempty"`
	Type      ChatType `bson:"type,omitempty"`
	Title     *string  `bson:"title,omitempty"`
	Username  *string  `bson:"username,omitempty"`
	FirstName *string  `bson:"first_name,omitempty"`
	LastName  *string  `bson:"last_name,omitempty"`
}

type ChatType

type ChatType string
const (
	PrivateChatType    ChatType = "private"
	GroupChatType      ChatType = "group"
	SupergroupChatType ChatType = "supergroup"
	ChannelChatType    ChatType = "channel"
)

type ChatsRepo

type ChatsRepo interface {
	Create(ctx context.Context, chats ...*Chat) ([]*Chat, error)
	CreateIfNotExist(ctx context.Context, chats ...*Chat) ([]*Chat, error)
}

type ChosenInlineResult

type ChosenInlineResult struct {
	ResultID        string    `bson:"result_id,omitempty"`
	From            User      `bson:"from,omitempty"`
	Location        *Location `bson:"location,omitempty"`
	InlineMessageID *string   `bson:"inline_message_id,omitempty"`
	Query           string    `bson:"query,omitempty"`
}

type Contact

type Contact struct {
	PhoneNumber string  `bson:"phone_number,omitempty"`
	FirstName   string  `bson:"first_name,omitempty"`
	LastName    *string `bson:"last_name,omitempty"`
	UserID      *int64  `bson:"user_id,omitempty"`
	VCard       *string `bson:"vcard,omitempty"`
}

type Document

type Document struct {
	FileID   string     `bson:"file_id,omitempty"`
	Thumb    *PhotoSize `bson:"thumb,omitempty"`
	FileName *string    `bson:"file_name,omitempty"`
	MimeType *string    `bson:"mime_type,omitempty"`
	FileSize *int64     `bson:"file_size,omitempty"`
}

type EncryptedCredentials

type EncryptedCredentials struct {
	Data   string `bson:"data,omitempty"`
	Hash   string `bson:"hash,omitempty"`
	Secret string `bson:"secret,omitempty"`
}

type EncryptedPassportElement

type EncryptedPassportElement struct {
	Type        PassportElementType `bson:"type,omitempty"`
	Data        *string             `bson:"data,omitempty"`
	PhoneNumber *string             `bson:"phone_number,omitempty"`
	Email       *string             `bson:"email,omitempty"`
	Files       []PassportFile      `bson:"files,omitempty"`
	FrontSide   []PassportFile      `bson:"front_side,omitempty"`
	ReverseSide []PassportFile      `bson:"reverse_side,omitempty"`
	Selfie      []PassportFile      `bson:"selfie,omitempty"`
	Translation []PassportFile      `bson:"translation,omitempty"`
	Hash        string              `bson:"hash,omitempty"`
}

type Game

type Game struct {
	Title        string          `bson:"title,omitempty"`
	Description  string          `bson:"description,omitempty"`
	Photo        []PhotoSize     `bson:"photo,omitempty"`
	Text         *string         `bson:"text,omitempty"`
	TextEntities []MessageEntity `bson:"text_entities,omitempty"`
	Animation    *Animation      `bson:"animation,omitempty"`
}

type InlineKeyboardButton

type InlineKeyboardButton struct {
	Text                         string    `bson:"text,omitempty"`
	URL                          *string   `bson:"url,omitempty"`
	LoginURL                     *LoginURL `bson:"login_url,omitempty"`
	CallbackData                 *string   `bson:"callback_data,omitempty"`
	SwitchInlineQuery            *string   `bson:"switch_inline_query,omitempty"`
	SwitchInlineQueryCurrentChat *string   `bson:"switch_inline_query_current_chat,omitempty"`
	CallbackGame                 *Game     `bson:"callback_game,omitempty"`
	Pay                          *bool     `bson:"pay,omitempty"`
}

type InlineKeyboardMarkup

type InlineKeyboardMarkup struct {
	InlineKeyboard [][]InlineKeyboardButton `bson:"inline_keyboard,omitempty"`
}

type InlineQuery

type InlineQuery struct {
	ID       string    `bson:"id,omitempty"`
	From     User      `bson:"from,omitempty"`
	Location *Location `bson:"location,omitempty"`
	Query    string    `bson:"query,omitempty"`
	Offset   string    `bson:"offset,omitempty"`
}

type Invoice

type Invoice struct {
	Title          string `bson:"title,omitempty"`
	Description    string `bson:"description,omitempty"`
	StartParameter string `bson:"start_parameter,omitempty"`
	Currency       string `bson:"currency,omitempty"`
	TotalAmount    int    `bson:"total_amount,omitempty"`
}

type Location

type Location struct {
	Longitude float32 `bson:"longitude,omitempty"`
	Latitude  float32 `bson:"latitude,omitempty"`
}

type Logger

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

func NewUpdatesLogger

func NewUpdatesLogger(r UpdatesRepo) *Logger

func (*Logger) LogUpdates

func (l *Logger) LogUpdates(updates ...*tb.Update) error

type LoginURL

type LoginURL struct {
	URL                string  `bson:"url,omitempty"`
	ForwardText        *string `bson:"forward_text,omitempty"`
	BotUsername        *string `bson:"bot_username,omitempty"`
	RequestWriteAccess *bool   `bson:"request_write_access,omitempty"`
}

type MaskPosition

type MaskPosition struct {
	Point  MaskPositionPoint `bson:"point,omitempty"`
	XShift float32           `bson:"x_shift,omitempty"`
	YShift float32           `bson:"y_shift,omitempty"`
	Scale  float32           `bson:"scale,omitempty"`
}

type MaskPositionPoint

type MaskPositionPoint string
const (
	ForeheadMaskPositionPoint MaskPositionPoint = "forehead"
	EyesMaskPositionPoint     MaskPositionPoint = "eyes"
	MouthMaskPositionPoint    MaskPositionPoint = "mouth"
	ChinMaskPositionPoint     MaskPositionPoint = "chin"
)

type Message

type Message struct {
	MessageID             int64                 `bson:"message_id,omitempty"`
	From                  *User                 `bson:"from,omitempty"`
	Date                  time.Time             `bson:"date,omitempty"`
	Chat                  *Chat                 `bson:"chat,omitempty"`
	ForwardFrom           *User                 `bson:"forward_from,omitempty"`
	ForwardFromChat       *Chat                 `bson:"forward_from_chat,omitempty"`
	ForwardFromMessageID  *int64                `bson:"forward_from_message_id,omitempty"`
	ForwardSignature      *string               `bson:"forward_signature,omitempty"`
	ForwardSenderName     *string               `bson:"forward_sender_name,omitempty"`
	ForwardDate           *time.Time            `bson:"forward_date,omitempty"`
	ReplyToMessage        *Message              `bson:"reply_to_message,omitempty"`
	EditDate              *time.Time            `bson:"edit_date,omitempty"`
	MediaGroupID          *string               `bson:"media_group_id,omitempty"`
	AuthorSignature       *string               `bson:"author_signature,omitempty"`
	Text                  *string               `bson:"text,omitempty"`
	Entities              []MessageEntity       `bson:"entities,omitempty"`
	CaptionEntities       []MessageEntity       `bson:"caption_entities,omitempty"`
	Audio                 *Audio                `bson:"audio,omitempty"`
	Document              *Document             `bson:"document,omitempty"`
	Animation             *Animation            `bson:"animation,omitempty"`
	Game                  *Game                 `bson:"game,omitempty"`
	Photo                 []PhotoSize           `bson:"photo,omitempty"`
	Sticker               *Sticker              `bson:"sticker,omitempty"`
	Video                 *Video                `bson:"video,omitempty"`
	Voice                 *Voice                `bson:"voice,omitempty"`
	VideoNote             *VideoNote            `bson:"video_note,omitempty"`
	Caption               *string               `bson:"caption,omitempty"`
	Contact               *Contact              `bson:"contact,omitempty"`
	Location              *Location             `bson:"location,omitempty"`
	Venue                 *Venue                `bson:"venue,omitempty"`
	Poll                  *Poll                 `bson:"poll,omitempty"`
	NewChatMembers        []User                `bson:"new_chat_members,omitempty"`
	LeftChatMember        *User                 `bson:"left_chat_member,omitempty"`
	NewChatTitle          *string               `bson:"new_chat_title,omitempty"`
	NewChatPhoto          []PhotoSize           `bson:"new_chat_photo,omitempty"`
	DeleteChatPhoto       bool                  `bson:"delete_chat_photo,omitempty"`
	GroupChatCreated      bool                  `bson:"group_chat_created,omitempty"`
	SupergroupChatCreated bool                  `bson:"supergroup_chat_created,omitempty"`
	ChannelChatCreated    bool                  `bson:"channel_chat_created,omitempty"`
	MigrateToChatID       *int64                `bson:"migrate_to_chat_id,omitempty"`
	MigrateFromChatID     *int64                `bson:"migrate_from_chat_id,omitempty"`
	PinnedMessage         *Message              `bson:"pinned_message,omitempty"`
	Invoice               *Invoice              `bson:"invoice,omitempty"`
	SuccessfulPayment     *SuccessfulPayment    `bson:"successful_payment,omitempty"`
	ConnectedWebsite      *string               `bson:"connected_website,omitempty"`
	PassportData          *PassportData         `bson:"passport_data,omitempty"`
	ReplyMarkup           *InlineKeyboardMarkup `bson:"reply_markup,omitempty"`
}

type MessageEntity

type MessageEntity struct {
	Type   MessageEntityType `bson:"type,omitempty"`
	Offset int               `bson:"offset,omitempty"`
	Length int               `bson:"length,omitempty"`
	URL    *string           `bson:"url,omitempty"`
	User   *User             `bson:"user,omitempty"`
}

type MessageEntityType

type MessageEntityType string
const (
	HashtagMessageEntityType     MessageEntityType = "hashtag"
	CashtagMessageEntityType     MessageEntityType = "cashtag"
	BotCommandMessageEntityType  MessageEntityType = "bot_command"
	URLMessageEntityType         MessageEntityType = "url"
	EmailMessageEntityType       MessageEntityType = "email"
	PhoneNumberMessageEntityType MessageEntityType = "phone_number"
	BoldMessageEntityType        MessageEntityType = "bold"
	ItalicMessageEntityType      MessageEntityType = "italic"
	CodeEntityType               MessageEntityType = "code"
	PreMessageEntityType         MessageEntityType = "pre"
	TextLinkMessageEntityType    MessageEntityType = "text_link"
	TextMentionMessageEntityType MessageEntityType = "text_mention"
)

type OrderInfo

type OrderInfo struct {
	Name            *string          `bson:"name,omitempty"`
	PhoneNumber     *string          `bson:"phone_number,omitempty"`
	Email           *string          `bson:"email,omitempty"`
	ShippingAddress *ShippingAddress `bson:"shipping_address,omitempty"`
}

type PassportData

type PassportData struct {
	Data        *EncryptedPassportElement `bson:"data,omitempty"`
	Credentials *EncryptedCredentials     `bson:"credentials,omitempty"`
}

type PassportElementType

type PassportElementType string
const (
	PersonalDetailsPassportElementType       PassportElementType = "personal_details"
	PassportPassportElementType              PassportElementType = "passport"
	DriverLicensePassportElementType         PassportElementType = "driver_license"
	IdentityCardPassportElementType          PassportElementType = "identity_card"
	InternalPassportPassportElementType      PassportElementType = "internal_passport"
	AddressPassportElementType               PassportElementType = "address"
	UtilityBillPassportElementType           PassportElementType = "utility_bill"
	BankStatementPassportElementType         PassportElementType = "bank_statement"
	RentalAgreementPassportElementType       PassportElementType = "rental_agreement"
	PassportRegistrationPassportElementType  PassportElementType = "passport_registration"
	TemporaryRegistrationPassportElementType PassportElementType = "temporary_registration"
	PhoneNumberPassportElementType           PassportElementType = "phone_number"
	EmailPassportElementType                 PassportElementType = "email"
)

type PassportFile

type PassportFile struct {
	FileID   string    `bson:"file_id,omitempty"`
	FileSize int64     `bson:"file_size,omitempty"`
	FileDate time.Time `bson:"file_date,omitempty"`
}

type PhotoSize

type PhotoSize struct {
	FileID   string `bson:"file_id,omitempty"`
	Width    int    `bson:"width,omitempty"`
	Height   int    `bson:"height,omitempty"`
	FileSize *int64 `bson:"file_size,omitempty"`
}

type Poll

type Poll struct {
	ID       string       `bson:"id,omitempty"`
	Question string       `bson:"question,omitempty"`
	Options  []PollOption `bson:"options,omitempty"`
	IsClosed bool         `bson:"is_closed,omitempty"`
}

type PollOption

type PollOption struct {
	Text       string `bson:"text,omitempty"`
	VoterCount int    `bson:"voter_count,omitempty"`
}

type PreCheckoutQuery

type PreCheckoutQuery struct {
	ID               string     `bson:"id,omitempty"`
	From             User       `bson:"from,omitempty"`
	Currency         string     `bson:"currency,omitempty"`
	TotalAmount      int        `bson:"total_amount,omitempty"`
	InvoicePayload   string     `bson:"invoice_payload,omitempty"`
	ShippingOptionID *string    `bson:"shipping_option_id,omitempty"`
	OrderInfo        *OrderInfo `bson:"order_info,omitempty"`
}

type ShippingAddress

type ShippingAddress struct {
	CountryCode string `bson:"country_code,omitempty"`
	State       string `bson:"state,omitempty"`
	City        string `bson:"city,omitempty"`
	StreetLine1 string `bson:"street_line1,omitempty"`
	StreetLine2 string `bson:"street_line2,omitempty"`
	PostCode    string `bson:"post_code,omitempty"`
}

type ShippingQuery

type ShippingQuery struct {
	ID              string          `bson:"id,omitempty"`
	From            User            `bson:"from,omitempty"`
	InvoicePayload  string          `bson:"invoice_payload,omitempty"`
	ShippingAddress ShippingAddress `bson:"shipping_address,omitempty"`
}

type Sticker

type Sticker struct {
	FileID       string        `bson:"file_id,omitempty"`
	Width        int           `bson:"width,omitempty"`
	Height       int           `bson:"height,omitempty"`
	IsAnimated   bool          `bson:"is_animated,omitempty"`
	Thumb        *PhotoSize    `bson:"thumb,omitempty"`
	Emoji        *string       `bson:"emoji,omitempty"`
	SetName      *string       `bson:"set_name,omitempty"`
	MaskPosition *MaskPosition `bson:"mask_position,omitempty"`
	FileSize     *int64        `bson:"file_size,omitempty"`
}

type SuccessfulPayment

type SuccessfulPayment struct {
	Currency                string     `bson:"currency,omitempty"`
	TotalAmount             int        `bson:"total_amount,omitempty"`
	InvoicePayload          string     `bson:"invoice_payload,omitempty"`
	ShippingOptionID        *string    `bson:"shipping_option_id,omitempty"`
	OrderInfo               *OrderInfo `bson:"order_info,omitempty"`
	TelegramPaymentChargeID string     `bson:"telegram_payment_charge_id,omitempty"`
	ProviderPaymentChargeID string     `bson:"provider_payment_charge_id,omitempty"`
}

type Update

type Update struct {
	UpdateID           int64               `bson:"update_id,omitempty"`
	Message            *Message            `bson:"message,omitempty"`
	EditedMessage      *Message            `bson:"edited_message,omitempty"`
	ChannelPost        *Message            `bson:"channel_post,omitempty"`
	EditedChannelPost  *Message            `bson:"edited_channel_post,omitempty"`
	InlineQuery        *InlineQuery        `bson:"inline_query,omitempty"`
	ChosenInlineResult *ChosenInlineResult `bson:"chosen_inline_result,omitempty"`
	CallbackQuery      *CallbackQuery      `bson:"callback_query,omitempty"`
	ShippingQuery      *ShippingQuery      `bson:"shipping_query,omitempty"`
	PreCheckoutQuery   *PreCheckoutQuery   `bson:"pre_checkout_query,omitempty"`
	Poll               *Poll               `bson:"poll,omitempty"`
}

func (*Update) Chat

func (u *Update) Chat() *Chat

func (*Update) From

func (u *Update) From() *User

type UpdatesRepo

type UpdatesRepo interface {
	Create(ctx context.Context, updates ...*Update) ([]*Update, error)
	CreateIfNotExist(ctx context.Context, updates ...*Update) ([]*Update, error)
}

type User

type User struct {
	ID           int64   `bson:"id,omitempty"`
	IsBot        bool    `bson:"is_bot,omitempty"`
	FirstName    string  `bson:"first_name,omitempty"`
	LastName     *string `bson:"last_name,omitempty"`
	Username     *string `bson:"username,omitempty"`
	LanguageCode *string `bson:"language_code,omitempty"`
}

type UsersRepo

type UsersRepo interface {
	Create(ctx context.Context, users ...*User) ([]*User, error)
	CreateIfNotExist(ctx context.Context, users ...*User) ([]*User, error)
}

type Venue

type Venue struct {
	Location       Location `bson:"location,omitempty"`
	Title          string   `bson:"title,omitempty"`
	Address        string   `bson:"address,omitempty"`
	FourSquareID   *string  `bson:"foursquare_id,omitempty"`
	FourSquareType *string  `bson:"foursquare_type,omitempty"`
}

type Video

type Video struct {
	FileID   string        `bson:"file_id,omitempty"`
	Width    int           `bson:"width,omitempty"`
	Height   int           `bson:"height,omitempty"`
	Duration time.Duration `bson:"duration,omitempty"`
	Thumb    *PhotoSize    `bson:"thumb,omitempty"`
	MimeType *string       `bson:"mime_type,omitempty"`
	FileSize *int64        `bson:"file_size,omitempty"`
}

type VideoNote

type VideoNote struct {
	FileID   string        `bson:"file_id,omitempty"`
	Length   int           `bson:"length,omitempty"`
	Duration time.Duration `bson:"duration,omitempty"`
	Thumb    *PhotoSize    `bson:"thumb,omitempty"`
	FileSize *int64        `bson:"file_size,omitempty"`
}

type Voice

type Voice struct {
	FileID   string        `bson:"file_id,omitempty"`
	Duration time.Duration `bson:"duration,omitempty"`
	MimeType *string       `bson:"mime_type,omitempty"`
	FileSize *int64        `bson:"file_size,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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