database

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2022 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB

Functions

func ClearOldItems

func ClearOldItems()

Clear proxies unusable more than 1 week

func GetAllProxies

func GetAllProxies() (proxies proxy.ProxyList)

Get a proxy list consists of all proxies in database

func InitTables

func InitTables()

func SaveProxyList

func SaveProxyList(pl proxy.ProxyList)

Types

type Proxy

type Proxy struct {
	ID        uint `gorm:"primarykey"`
	CreatedAt time.Time
	UpdatedAt time.Time
	proxy.Base
	Link       string
	Identifier string `gorm:"unique"`
}

设置数据库字段,表名为默认为type名的复数。相比于原作者,不使用软删除特性

Jump to

Keyboard shortcuts

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