Documentation
¶
Index ¶
- Constants
- Variables
- func NewDBEngine(cnf *conf.NeoConf) (db *gorm.DB, err error)
- type Country
- func (that *Country) Count(db *gorm.DB) (count int64, err error)
- func (that *Country) Create(db *gorm.DB) (*Country, error)
- func (that *Country) CreateOrUpdateCountryItem(db *gorm.DB) (err error)
- func (that *Country) DeleteAll(db *gorm.DB) (err error)
- func (that *Country) GetByNameCN(db *gorm.DB) (*Country, error)
- func (that *Country) TableName() string
- func (that *Country) Update(db *gorm.DB, values any) error
- type Location
- type Model
- type Proxy
- func (that *Proxy) CountBySchemeOrSourceType(db *gorm.DB) (count int64, err error)
- func (that *Proxy) Create(db *gorm.DB) (*Proxy, error)
- func (that *Proxy) Delete(db *gorm.DB) (err error)
- func (that *Proxy) DeleteAll(db *gorm.DB) (err error)
- func (that *Proxy) Get(db *gorm.DB) (*Proxy, error)
- func (that *Proxy) GetItemListBySourceType(db *gorm.DB) (pList []*outbound.ProxyItem, err error)
- func (that *Proxy) TableName() string
- func (that *Proxy) Update(db *gorm.DB, values any) error
- type WireGuard
- func (that *WireGuard) Create(db *gorm.DB) (*WireGuard, error)
- func (that *WireGuard) DeleteAll(db *gorm.DB) (err error)
- func (that *WireGuard) DeleteByType(db *gorm.DB) (err error)
- func (that *WireGuard) GetByHost(db *gorm.DB) (*WireGuard, error)
- func (that *WireGuard) GetIPListByPort(db *gorm.DB) (wList []*WireGuard, err error)
- func (that *WireGuard) GetIPListByType(db *gorm.DB) (wList []*WireGuard, err error)
- func (that *WireGuard) TableName() string
Constants ¶
View Source
const ( SourceTypeHistory string = "history" SourceTypeEdgeTunnel string = "edtunnel" SourceTypeManually string = "manual" )
View Source
const ( WireGuardTypeIP string = "ip" WireGuardTypeDomain string = "domain" )
Variables ¶
View Source
var (
DBEngine *gorm.DB
)
Functions ¶
Types ¶
type Country ¶
type Country struct { *Model NameCN string `json:"name_cn" gorm:"uniqueIndex"` ISOTwo string `json:"iso_two"` ISOThree string `json:"iso_three"` FullEng string `json:"full_eng"` }
func NewCountryItem ¶
func NewCountryItem() (c *Country)
func (*Country) CreateOrUpdateCountryItem ¶
type Location ¶
type Location struct { *Model IP string `json:"ip" gorm:"uniqueIndex"` Country string `json:"country"` }
func NewLocation ¶
func NewLocation() (l *Location)
type Proxy ¶
type Proxy struct { *Model Scheme string `json:"scheme"` Address string `json:"address" gorm:"uniqueIndex:idx_addr_port"` Port int `json:"port" gorm:"uniqueIndex:idx_addr_port"` RTT int64 `json:"rtt"` RawUri string `json:"raw_uri"` Location string `json:"location"` Outbound string `json:"outbound"` OutboundType outbound.ClientType `json:"outbound_type"` SourceType string `json:"source_type"` }
func (*Proxy) CountBySchemeOrSourceType ¶
func (*Proxy) GetItemListBySourceType ¶
type WireGuard ¶
type WireGuard struct { *Model Address string `json:"address"` Port int `json:"port"` RTT int64 `json:"rtt"` PacketLoss float32 `json:"packet_loss"` Type string `json:"type"` }
func NewWireGuardItem ¶
func NewWireGuardItem() (w *WireGuard)
func (*WireGuard) GetIPListByPort ¶
func (*WireGuard) GetIPListByType ¶
Click to show internal directories.
Click to hide internal directories.