ipModel

package
v0.0.0-...-5807ea9 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: Apache-2.0 Imports: 3 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountIp

func CountIp() int64

CountIp 查询共有多少条数据

func DeleteIp

func DeleteIp(ip *IP)

DeleteIp 删除数据

func SaveIp

func SaveIp(ip *IP)

SaveIp 保存数据到数据库

func UpdateIp

func UpdateIp(ip *IP)

UpdateIp 更新数据

Types

type IP

type IP struct {
	ProxyId       int64  `gorm:"primary_key; auto_increment; not null" json:"-"`
	ProxyHost     string `gorm:"type:varchar(255); not null; unique" json:"proxyHost"`
	ProxyPort     int    `gorm:"type:int(11); not null; unique" json:"proxyPort"`
	ProxyType     string `gorm:"type:varchar(64); not null" json:"proxyType"`
	ProxyLocation string `gorm:"type:varchar(255); default null" json:"proxyLocation"`
	ProxySpeed    int    `gorm:"type:int(20); not null; default 0" json:"proxySpeed"`
	ProxySource   string `gorm:"type:varchar(64); not null;" json:"proxySource"`
	CreateTime    string `gorm:"type:varchar(50); not null" json:"-"`
	UpdateTime    string `gorm:"type:varchar(50); default ''" json:"updateTime"`
}

IP struct

func GetAllIp

func GetAllIp() []IP

GetAllIp 获取所有数据

func GetIpByProxyHost

func GetIpByProxyHost(host string) *IP

GetIpByProxyHost 根据 proxyHost 获取一条数据

func GetIpByProxyType

func GetIpByProxyType(proxyType string) ([]IP, error)

GetIpByProxyType 根据 proxyType 获取一条数据

Jump to

Keyboard shortcuts

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