ftconn

package
v0.0.0-...-0de21b9 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Orm *xorm.Engine
)

Functions

func InitModelEngine

func InitModelEngine(cfg svc.ValueDbconf) (err error)

InitModelEngine init engine

func MySQL

func MySQL(cfg svc.ValueDbconf) (err error)

MySQL init mysql db

func SQLite

func SQLite(cfg svc.ValueDbconf) (err error)

SQLite sqlite engine

Types

type Natinfo

type Natinfo struct {
	ID            uint32 `json:"_" xorm:"id"`
	Did           string `json:"did" xorm:"did"`
	UserID        int64  `json:"user_id" xorm:"user_id"`
	Upnp          int32  `json:"upnp" xorm:"upnp"`
	UpnpProtocol  int32  `json:"upnp_protocol"`
	UpnpPort      int32  `json:"upnp_pprt"`
	NatType       int32  `json:"nat_type"`
	LocalIP       string `json:"local_ip" xorm:"local_ip"`
	LocalPort     int32  `json:"local_port"`
	OutsideIpaddr string `json:"outside_ipaddr" xorm:"outside_ipaddr"`
	LocalSsid     string `json:"local_ssid"`
	LocalGateway  string `json:"local_gateway"`
	GatewayMac    string `json:"gateway_mac"`
	LastTime      int64  `json:"last_time"`
}

Natinfo table name natinfo struct define

func (*Natinfo) Add

func (obj *Natinfo) Add() (code uint64, err error)

Add add record

func (*Natinfo) Delete

func (obj *Natinfo) Delete() (code uint64, err error)

Delete delete record

func (*Natinfo) Get

func (obj *Natinfo) Get() (code uint64, err error)

Get get record

func (*Natinfo) GetAdv

func (obj *Natinfo) GetAdv() (code uint64, err error)

GetAdv get record

func (*Natinfo) Reset

func (obj *Natinfo) Reset() (code uint64, err error)

Reset reset struct

func (*Natinfo) Set

func (obj *Natinfo) Set() (code uint64, err error)

Set add or update record

func (*Natinfo) Update

func (obj *Natinfo) Update() (code uint64, err error)

Update update record

type P2pinfo

type P2pinfo struct {
	ID                uint32 `json:"_" xorm:"id"`
	Did               string `json:"did" xorm:"did"`
	UserID            int64  `json:"user_id" xorm:"user_id"`
	DeviceOutsideIP   string `json:"device_outside_ip" xorm:"device_outside_ip"`
	DeviceOutsidePort int32  `json:"device_outside_port" xorm:"device_outside_port"`
	DeviceLocalIP     string `json:"device_local_ip" xorm:"device_local_ip"`
	DeviceLocalPort   int32  `json:"device_local_port" xorm:"device_local_port"`
	UserOutsideIP     string `json:"user_outside_ip" xorm:"user_outside_ip"`
	UserOutsidePort   int32  `json:"user_outside_port" xorm:"user_outside_port"`
	UserLocalIP       string `json:"user_local_ip" xorm:"user_local_ip"`
	UserLocalPort     int32  `json:"user_local_port" xorm:"user_local_port"`
	SessionKey        string `json:"session_key"`
	P2psrvIP          string `json:"p2psrv_ip" xorm:"p2psrv_ip"`
	P2psrvPort        int32  `json:"p2psrv_port"`
	UserTime          int64  `json:"user_time"`
	DeviceTime        int64  `json:"device_time"`
}

P2pinfo table name p2pinfo struct define

func GetP2pInfo

func GetP2pInfo(did string, uid int64) (row *P2pinfo, err error)

GetP2pInfo get p2p info by did and uid.

func (*P2pinfo) Add

func (obj *P2pinfo) Add() (code uint64, err error)

Add add record

func (*P2pinfo) Delete

func (obj *P2pinfo) Delete() (code uint64, err error)

Delete delete record

func (*P2pinfo) Get

func (obj *P2pinfo) Get() (code uint64, err error)

Get get record

func (*P2pinfo) GetAdv

func (obj *P2pinfo) GetAdv() (code uint64, err error)

GetAdv get record

func (*P2pinfo) GetBySessionKey

func (obj *P2pinfo) GetBySessionKey() (code uint64, err error)

GetBySessionKey get record

func (*P2pinfo) Reset

func (obj *P2pinfo) Reset() (code uint64, err error)

Reset reset struct

func (*P2pinfo) Set

func (obj *P2pinfo) Set() (code uint64, err error)

Set add or update record

func (*P2pinfo) Update

func (obj *P2pinfo) Update() (code uint64, err error)

Update update record

func (*P2pinfo) UpdateBySessionKey

func (obj *P2pinfo) UpdateBySessionKey() (code uint64, err error)

UpdateBySessionKey update record

type Relayinfo

type Relayinfo struct {
	ID          uint32 `json:"_" xorm:"id"`
	RelayIpaddr string `json:"relay_ipaddr" xorm:"relay_ipaddr"`
	Did         string `json:"did" xorm:"did"`
	UserID      int64  `json:"user_id" xorm:"user_id"`
	SessionKey  string `json:"session_key"`
	UserTime    int64  `json:"user_time"`
	DeviceTime  int64  `json:"device_time"`
}

Relayinfo table name relayinfo struct define

func (*Relayinfo) Add

func (obj *Relayinfo) Add() (code uint64, err error)

Add add record

func (*Relayinfo) Delete

func (obj *Relayinfo) Delete() (code uint64, err error)

Delete delete record

func (*Relayinfo) Get

func (obj *Relayinfo) Get() (code uint64, err error)

Get get record

func (*Relayinfo) GetAdv

func (obj *Relayinfo) GetAdv() (code uint64, err error)

GetAdv get record

func (*Relayinfo) GetBySessionKey

func (obj *Relayinfo) GetBySessionKey() (code uint64, err error)

GetBySessionKey get record

func (*Relayinfo) Reset

func (obj *Relayinfo) Reset() (code uint64, err error)

Reset reset struct

func (*Relayinfo) Set

func (obj *Relayinfo) Set() (code uint64, err error)

Set add or update record

func (*Relayinfo) Update

func (obj *Relayinfo) Update() (code uint64, err error)

Update update record

func (*Relayinfo) UpdateBySessionKey

func (obj *Relayinfo) UpdateBySessionKey() (code uint64, err error)

UpdateBySessionKey update record

Jump to

Keyboard shortcuts

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