models

package
v0.0.0-...-480b165 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToJSON

func ToJSON(data interface{}) string

Types

type DeviceInfo

type DeviceInfo struct {
	MACAddress         string        `json:"macAddress"`
	IPAddress          string        `json:"ipAddress"`
	ConnectedAt        time.Time     `json:"connectedAt"`
	TotalConnectedTime time.Duration `json:"totalConnectedTime"`
	Connected          bool          `json:"connected"`
	LastChecked        time.Time     `json:"lastChecked"`
	DefaultGateway     string        `json:"defaultGateway"`
	Manufacturer       string        `json:"manufacturer"`
	InterfaceName      string        `json:"interfaceName"`
	HostSSID           string        `json:"hostSSID"`
}

type Erebrus

type Erebrus struct {
	UUID          string    `gorm:"primary_key" json:"UUID"`
	Name          string    `json:"name"`
	WalletAddress string    `json:"walletAddress"`
	UserId        string    `json:"userId,omitempty"`
	Region        string    `json:"region"`
	NodeId        string    `json:"nodeId"`
	Domain        string    `json:"domain"`
	CollectionId  string    `json:"collectionId"`
	CreatedAt     time.Time `json:"created_at"`
	Chain         string    `json:"chainName"`
}

type FlowId

type FlowId struct {
	FlowIdType    FlowIdType `sql:"flow_id_type"`
	UserId        string
	FlowId        string `gorm:"primary_key"`
	RelatedRoleId string
	WalletAddress string
}

TODO: Make relations for field `relatedRoleId`

type FlowIdType

type FlowIdType string
const (
	AUTH FlowIdType = "AUTH"
	ROLE FlowIdType = "ROLE"
)

func (*FlowIdType) Scan

func (fit *FlowIdType) Scan(value interface{}) error

func (FlowIdType) Value

func (fit FlowIdType) Value() (driver.Value, error)

type FormData

type FormData struct {
	ID            uint   `gorm:"primaryKey"`
	Email         string `json:"email" binding:"required"`
	TelegramID    string `json:"telegram_id"`
	Name          string `json:"name" binding:"required"`
	RanNodeBefore bool   `json:"ran_node_before"`
	ProjectName   string `json:"project_name"`
	ProjectID     string `json:"project_id"`
	WalletAddress string `json:"wallet_address"`
	TwitterID     string `json:"twitter_id"`
	Region        string `json:"region"`
	Chain         string `json:"chain"`
}

type IPInfo

type IPInfo struct {
	IPv4Addresses []string // IPv4 Addresses
	IPv6Addresses []string // IPv6 Addresses
}

IPInfo struct to store IP information

type IpGeoAddress

type IpGeoAddress struct {
	IpInfoIP       string
	IpInfoCity     string
	IpInfoCountry  string
	IpInfoLocation string
	IpInfoOrg      string
	IpInfoPostal   string
	IpInfoTimezone string
}

type Node

type Node struct {
	//using for db operation
	PeerId           string  `json:"peerId" gorm:"primaryKey"`
	Name             string  `json:"name"`
	HttpPort         string  `json:"httpPort"`
	Host             string  `json:"host"` //domain
	PeerAddress      string  `json:"peerAddress"`
	Region           string  `json:"region"`
	Status           string  `json:"status"` // offline 1, online 2, maintainance 3,block 4
	DownloadSpeed    float64 `json:"downloadSpeed"`
	UploadSpeed      float64 `json:"uploadSpeed"`
	RegistrationTime int64   `json:"registrationTime"` //StartTimeStamp
	LastPing         int64   `json:"lastPing"`
	Chain            string  `json:"chainName"`
	WalletAddress    string  `json:"walletAddress"`
	Version          string  `json:"version"`
	CodeHash         string  `json:"codeHash"`
	SystemInfo       string  `json:"systemInfo" gorm:"type:jsonb"`
	IpInfo           string  `json:"ipinfo" gorm:"type:jsonb"`
	IpGeoData        string  `json:"ipGeoData" gorm:"type:jsonb"`
}

type NodeAppends

type NodeAppends struct {
	PeerId           string  `json:"peerId" gorm:"primaryKey"`
	Name             string  `json:"name"`
	HttpPort         string  `json:"httpPort"`
	Host             string  `json:"host"` //domain
	PeerAddress      string  `json:"peerAddress"`
	Region           string  `json:"region"`
	Status           string  `json:"status"` // offline 1, online 2, maintainance 3,block 4
	DownloadSpeed    float64 `json:"downloadSpeed"`
	UploadSpeed      float64 `json:"uploadSpeed"`
	RegistrationTime int64   `json:"registrationTime"` //StartTimeStamp
	LastPing         int64   `json:"lastPing"`
	Chain            string  `json:"chain"`
	WalletAddress    string  `json:"walletAddress"`
	Version          string  `json:"version"`
	CodeHash         string  `json:"codeHash"`
	SystemInfo       OSInfo  `json:"systemInfo"`
	IpInfo           IPInfo  `json:"ipinfo"`
}

type NodeDwifi

type NodeDwifi struct {
	ID             uint      `json:"id" gorm:"primaryKey"`
	Gateway        string    `json:"gateway"`
	Status         string    `json:"-"`
	CreatedAt      time.Time `json:"created_at"`
	UpdatedAt      time.Time `json:"updated_at"`
	Password       string    `json:"password"`
	Location       string    `json:"location"`
	Price_per_min  string    `json:"price_per_min"`
	Wallet_address string    `json:"wallet_address"`
	Chain_name     string    `json:"chain_name"`
}

type NodeDwifiResponse

type NodeDwifiResponse struct {
	ID             uint         `json:"id"`
	Gateway        string       `json:"gateway"`
	CreatedAt      time.Time    `json:"created_at"`
	UpdatedAt      time.Time    `json:"updated_at"`
	Status         []DeviceInfo `json:"status"`
	Password       string       `json:"password"`
	Location       string       `json:"location"`
	Price_per_min  string       `json:"price_per_min"`
	Wallet_address string       `json:"wallet_address"`
	Chain_name     string       `json:"chain_name"`
}

type NodeResponse

type NodeResponse struct {
	Id                  string  `json:"id" gorm:"primaryKey"`
	Name                string  `json:"name"`
	HttpPort            string  `json:"httpPort"`
	Domain              string  `json:"domain"`
	NodeName            string  `json:"nodename"`
	Chain               string  `json:"chainName"`
	Address             string  `json:"address"`
	Region              string  `json:"region"`
	Status              string  `json:"status"`
	DownloadSpeed       float64 `json:"downloadSpeed"`
	UploadSpeed         float64 `json:"uploadSpeed"`
	StartTimeStamp      int64   `json:"startTimeStamp"`
	LastPingedTimeStamp int64   `json:"lastPingedTimeStamp"`
	WalletAddressSui    string  `json:"walletAddress"`
	WalletAddressSolana string  `json:"walletAddressSol"`
	IpInfoIP            string  `json:"ipinfoip"`
	IpInfoCity          string  `json:"ipinfocity"`
	IpInfoCountry       string  `json:"ipinfocountry"`
	IpInfoLocation      string  `json:"ipinfolocation"`
	IpInfoOrg           string  `json:"ipinfoorg"`
	IpInfoPostal        string  `json:"ipinfopostal"`
	IpInfoTimezone      string  `json:"ipinfotimezone"`
}

type OSInfo

type OSInfo struct {
	Name         string // Name of the operating system
	Hostname     string // Hostname of the system
	Architecture string // Architecture of the system
	NumCPU       int    // Number of CPUs
}

type Subscription

type Subscription struct {
	ID        uint      `gorm:"primary_key" json:"id,omitempty"`
	UserId    string    `json:"userId,omitempty"`
	Type      string    `json:"type,omitempty"`
	StartTime time.Time `json:"startTime,omitempty"`
	EndTime   time.Time `json:"endTime,omitempty"`
}

type TStripePiType

type TStripePiType string
var Erebrus111NFT TStripePiType = "Erebrus111NFT"

type User

type User struct {
	UserId            string         `gorm:"primary_key" json:"userId,omitempty"`
	Name              string         `json:"name,omitempty"`
	WalletAddress     *string        `json:"walletAddress,omitempty"`
	Discord           string         `json:"discord"`
	Twitter           string         `json:"twitter"`
	FlowIds           []FlowId       `gorm:"foreignkey:UserId" json:"-"`
	ProfilePictureUrl string         `json:"profilePictureUrl,omitempty"`
	Country           string         `json:"country,omitempty"`
	Feedbacks         []UserFeedback `gorm:"foreignkey:UserId" json:"userFeedbacks"`
	EmailId           *string        `json:"emailId,omitempty"`
}

type UserFeedback

type UserFeedback struct {
	UserId    string    `json:"-" gorm:"primary_key"`
	Feedback  string    `json:"feedback" binding:"required" gorm:"primary_key"`
	Rating    int       `json:"rating" binding:"gte=1,lte=5" gorm:"primary_key"`
	CreatedAt time.Time `json:"-"`
}

type UserStripePi

type UserStripePi struct {
	Id           string        `gorm:"primary_key" json:"id,omitempty"`
	UserId       string        `json:"userId,omitempty"`
	StripePiId   string        `json:"stripePiId,omitempty"`
	StripePiType TStripePiType `json:"stripePiType,omitempty"`
	CreatedAt    time.Time     `json:"createdAt,omitempty"`
}

type WifiNode

type WifiNode struct {
	gorm.Model
	NodeName      string `json:"node_name"`
	Location      string `json:"location"`
	WifiPassword  string `json:"wifi_password"`
	WalletAddress string `json:"wallet_address"`
	NodeType      string `json:"node_type"` //The type of WiFi node (e.g., public, private, business).
	Ssid          string `json:"ssid"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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