database

package
Version: v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2021 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名的复数。相比于原作者,不使用软删除特性

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL