Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Message ¶
type Message interface { Parse(body *WebhookBody) Message ToSheetRow() []interface{} SendAsTelegramMessage() (*http.Response, error) }
type Payment ¶
type Payment struct { Date string `json:"date"` Customer string `json:"customer"` Method string `json:"method"` Amount int64 `json:"amount"` WebhookBody WebhookBody `json:"webhhok_body"` }
func (*Payment) Parse ¶
func (p *Payment) Parse(body *WebhookBody) Message
func (*Payment) SendAsTelegramMessage ¶
func (*Payment) ToSheetRow ¶
func (p *Payment) ToSheetRow() []interface{}
type Transaction ¶
type Transaction struct { Date string `json:"date"` Customer string `json:"customer"` Product string `json:"product"` Price uint64 `json:"price"` WebhookBody WebhookBody `json:"webhhok_body"` }
func (*Transaction) Parse ¶
func (t *Transaction) Parse(body *WebhookBody) Message
func (*Transaction) SendAsTelegramMessage ¶
func (t *Transaction) SendAsTelegramMessage() (*http.Response, error)
func (*Transaction) ToSheetRow ¶
func (t *Transaction) ToSheetRow() []interface{}
type WebhookBody ¶
type WebhookBody struct { Message struct { From struct { ID int64 `json:"id"` FirstName string `json:"first_name"` } `json:"from"` Date uint64 `json:"date"` Text string `json:"text"` Chat struct { ID int64 `json:"id"` } `json:"chat"` } `json:"message"` }
func (*WebhookBody) IsValidUser ¶
func (body *WebhookBody) IsValidUser() bool
func (*WebhookBody) ToMessage ¶
func (body *WebhookBody) ToMessage() (Message, error)
Click to show internal directories.
Click to hide internal directories.