types

package
v0.0.0-...-16cd069 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2021 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Scan

func Scan(src interface{}, dst interface{}) error

func Value

func Value(m interface{}) (driver.Value, error)

Types

type Chat

type Chat struct {
	Model
	ID int64 `json:"id" gorm:"primaryKey"`

	// See ChatType and consts.
	Type tb.ChatType `json:"type"`

	// Won't be there for ChatPrivate.
	Title string `json:"title"`

	FirstName string `json:"first_name"`
	LastName  string `json:"last_name"`
	Username  string `json:"username"`

	// Still shows whether the user is a member
	// of the chat at the moment of the request.
	Still bool `json:"is_member,omitempty"`

	// Returns only in getChat
	Bio              string `json:"bio,omitempty"`
	Description      string `json:"description,omitempty"`
	InviteLink       string `json:"invite_link,omitempty"`
	SlowMode         int    `json:"slow_mode_delay,omitempty"`
	StickerSet       string `json:"sticker_set_name,omitempty"`
	CanSetStickerSet bool   `json:"can_set_sticker_set,omitempty"`
	LinkedChatID     int64  `json:"linked_chat_id,omitempty"`
}

func (*Chat) ToTb

func (p *Chat) ToTb() *tb.Chat

type CheckConfig

type CheckConfig struct {
	Model
	ID int64 `json:"id" gorm:"primaryKey"`

	ChatId int64  `json:"chat_id,omitempty" gorm:"index:chat_sub,unique"`
	SubUrl string `json:"sub_url,omitempty" gorm:"type:varchar(500);index:chat_sub,unique"`

	NextAt      uint32 `json:"next_at,omitempty" gorm:"index:idx_next_at"`
	SepDuration uint32 `json:"sep_duration,omitempty" gorm:"default:3600;comment:间隔,单位秒"`

	AlarmAliveRate float64 `json:"alarm_alive_rate,omitempty" gorm:"default:0;comment:报警的通过率,百分比"`
	AlarmReceiver  string  `json:"alarm_receiver,omitempty" gorm:"default:\"\""`
}

func (CheckConfig) GetHash

func (p CheckConfig) GetHash() string

type Context

type Context struct {
	TbContext tb.Context

	User User
	Chat Chat
}

type Model

type Model struct {
	Id        uint64 `json:"id,omitempty" gorm:"primaryKey"`
	CreatedAt uint32 `json:"created_at,omitempty" gorm:"autoCreateTime:autoCreateTime"`
	UpdatedAt uint32 `json:"updated_at,omitempty" gorm:"autoUpdateTime:autoUpdateTime"`
	DeletedAt uint32 `json:"deleted_at,omitempty"`
}

type Statistics

type Statistics struct {
	StatisticalDate string `json:"statistical_time" gorm:"primaryKey;index:idx_date"`

	VisitCheckCount uint64 `json:"visit_check_count,omitempty"`
	BaseCheckCount  uint64 `json:"base_check_count,omitempty"`
	FullCheckCount  uint64 `json:"full_check_count,omitempty"`

	AutoCheckCount uint64 `json:"auto_check_count,omitempty"`
}

type User

type User struct {
	Model

	ID int64 `json:"id" gorm:"primaryKey"`

	FirstName    string `json:"first_name"`
	LastName     string `json:"last_name"`
	Username     string `json:"username"`
	LanguageCode string `json:"language_code"`
	IsBot        bool   `json:"is_bot"`

	// Returns only in getMe
	CanJoinGroups   bool `json:"can_join_groups"`
	CanReadMessages bool `json:"can_read_all_group_messages"`
	SupportsInline  bool `json:"supports_inline_queries"`
}

func (*User) ToTb

func (p *User) ToTb() *tb.User

Jump to

Keyboard shortcuts

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