models

package
v0.0.0-...-ed1bf1c Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteIPProxy

func DeleteIPProxy(req *DeleteIPProxyRequest) error

func GetIPProxyCount

func GetIPProxyCount() int64

func UpsertIPProxy

func UpsertIPProxy(proxy *IPProxy) error

Types

type DeleteIPProxyRequest

type DeleteIPProxyRequest struct {
	IP   string `form:"ip" json:"ip"`
	Port int    `form:"port" json:"port"`
}

type IPProxy

type IPProxy struct {
	ID        uint64       `gorm:"primaryKey;autoIncrement"`
	IP        string       `gorm:"type:varchar(63);not null;uniqueIndex:idx_ip_port"`
	Port      int          `gorm:"not null;uniqueIndex:idx_ip_port"`
	Type      ProxyType    `gorm:"not null"`
	Protocol  ProtocolType `gorm:"not null"`
	Country   string       `gorm:"type:varchar(63)"`
	Region    string       `gorm:"type:varchar(63)"`
	ISP       string       `gorm:"type:varchar(63)"`
	Source    string       `gorm:"type:varchar(63);not null"`
	UpdatedAt int64        `gorm:"not null"`
}

func ListIPProxy

func ListIPProxy(req *ListIPProxyRequest) []*IPProxy

type ListIPProxyRequest

type ListIPProxyRequest struct {
	Type     ProxyType    `form:"type" json:"type"`
	Protocol ProtocolType `form:"protocol" json:"protocol"`
	Limit    int64        `form:"limit" json:"limit"`
}

type ProtocolType

type ProtocolType int8
const (
	HTTP ProtocolType = iota + 1
	HTTPS
	Both
)

type ProxyType

type ProxyType int8
const (
	TransparentProxy ProxyType = iota + 1
	AnonymousProxy
	HighAnonymityProxy
)

Jump to

Keyboard shortcuts

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