model

package
v0.0.0-...-c266f6d Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PingFail int8 = 0
	PingOk   int8 = 1
)
View Source
const (
	CrawHtml CrawType = 1 // 网站是HTML
	CrawApi  CrawType = 2 // 网站是JSON接口

	ByType  = 1 // 通过服务器类型
	ByHosts = 2 // 服务器IPs

	Disable = 0 // 禁用
	Enable  = 1 // 启用
)
View Source
const (
	AuthGithub = iota
	AuthWeibo
)
View Source
const DB_MU = "mu"

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseModel

type BaseModel struct {
	ID        uint      `gorm:"column:id" json:"id"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type CrawType

type CrawType int

type Favor

type Favor struct {
	ID        int       `gorm:"id"`
	UserId    int       `gorm:"user_id"`
	Site      string    `gorm:"site"`
	Key       string    `gorm:"key"`
	OriginUrl string    `gorm:"origin_url"`
	Title     string    `gorm:"title"`
	CreateAt  time.Time `gorm:"create_at"`
}

func (*Favor) TableName

func (f *Favor) TableName() string

type News

type News struct {
	T    string     `json:"t"`
	List []NewsItem `json:"list"`
}

type NewsItem

type NewsItem struct {
	Key       string            `json:"key"`
	Title     string            `json:"title"`
	Desc      string            `json:"desc"`
	Rank      float64           `json:"rank"`
	OriginUrl string            `json:"origin_url"`
	Card      uint8             `json:"card_type"`
	Ext       map[string]string `json:"ext"`
}

type Node

type Node struct {
	ID       int       `gorm:"id" json:"id"`
	Name     string    `gorm:"name" json:"name"`
	Addr     string    `gorm:"addr" json:"addr"`
	Type     int8      `gorm:"type" json:"type"`
	Enable   int8      `gorm:"enable" json:"enable"`
	Ping     int8      `gorm:"ping" json:"ping"`
	CreateAt time.Time `gorm:"create_at" json:"create_at"`
}

func (*Node) TableName

func (node *Node) TableName() string

type Site

type Site struct {
	ID         int    `gorm:"primaryKey"`
	Name       string `gorm:"name"`
	Root       string `gorm:"root"`
	Key        string `gorm:"key"`
	Desc       string `gorm:"desc"`
	Type       int8   `gorm:"type"`
	Tags       string `gorm:"tags"`
	Cron       string `gorm:"cron"`
	Enable     int8   `gorm:"enable"`
	NodeOption int8   `gorm:"node_option"`
	NodeType   int8   `gorm:"node_type"`
	NodeHosts  string `gorm:"node_hosts"`
	ReqHeaders string `gorm:"req_headers"`
}

func (*Site) TableName

func (s *Site) TableName() string

type User

type User struct {
	ID       int       `gorm:"id"`
	Username string    `gorm:"username"`
	Nickname string    `gorm:"nickname"`
	Avatar   string    `gorm:"avatar"`
	AuthType string    `gorm:"auth_type"`
	AuthTime time.Time `gorm:"auth_time"`
	Token    string    `gorm:"token"`
	ExpireAt int64     `gorm:"expire_at"`
}

func (*User) TableName

func (u *User) TableName() string

Jump to

Keyboard shortcuts

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