types

package
v0.17.5 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2025 License: Apache-2.0 Imports: 6 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Zos3NodesFeatures = []string{"zmount", "zdb", "volume", "ipv4", "ip", "gateway-name-proxy",
		"gateway-fqdn-proxy", "qsfs", "zlogs", "network", "zmachine", "wireguard", "yggdrasil", "mycelium"}
	Zos4NodesFeatures = []string{"zmount", "zdb", "volume", "gateway-name-proxy",
		"gateway-fqdn-proxy", "qsfs", "zlogs", "zmachine-light", "network-light", "mycelium"}
	FeaturesSet = []string{"zmount", "zdb", "volume", "ipv4", "ip", "gateway-name-proxy",
		"gateway-fqdn-proxy", "qsfs", "zlogs", "network", "zmachine", "zmachine-light", "network-light",
		"wireguard", "yggdrasil", "mycelium"}
)

Functions

This section is empty.

Types

type BIOS added in v0.15.0

type BIOS struct {
	Vendor  string `json:"vendor"`
	Version string `json:"version"`
}

type Baseboard added in v0.15.0

type Baseboard struct {
	Manufacturer string `json:"manufacturer"`
	ProductName  string `json:"product_name"`
}

type Capacity

type Capacity struct {
	CRU uint64         `json:"cru"`
	SRU gridtypes.Unit `json:"sru"`
	HRU gridtypes.Unit `json:"hru"`
	MRU gridtypes.Unit `json:"mru"`
}

Capacity is the resources needed for workload(cpu, memory, SSD disk, HDD disks)

type CapacityResult

type CapacityResult struct {
	Total Capacity `json:"total_resources"`
	Used  Capacity `json:"used_resources"`
}

CapacityResult is the NodeData capacity results to unmarshal json in it

type Contract

type Contract struct {
	ContractID uint        `json:"contract_id" sort:"contract_id"`
	TwinID     uint        `json:"twin_id" sort:"twin_id"`
	State      string      `json:"state" sort:"state"`
	CreatedAt  uint        `json:"created_at" sort:"created_at"`
	Type       string      `json:"type" sort:"type"`
	Details    interface{} `json:"details"`
}

Contract represents a contract and its details after decoding to one of Details structs.

type ContractBilling

type ContractBilling struct {
	AmountBilled     uint64 `json:"amountBilled"`
	DiscountReceived string `json:"discountReceived"`
	Timestamp        uint64 `json:"timestamp"`
	ContractId       uint64 `json:"contract_id,omitempty"`
}

ContractBilling is contract billing info

type ContractDetails added in v0.11.8

type ContractDetails interface {
	RentContractDetails | NameContractDetails | NodeContractDetails
}

ContractDetails represent details for all contract types

type ContractFilter

type ContractFilter struct {
	ContractID        *uint64  `schema:"contract_id,omitempty"`
	TwinID            *uint64  `schema:"twin_id,omitempty"`
	NodeID            *uint64  `schema:"node_id,omitempty"`
	Type              *string  `schema:"type,omitempty"`
	State             []string `schema:"state,omitempty"`
	Name              *string  `schema:"name,omitempty"`
	NumberOfPublicIps *uint64  `schema:"number_of_public_ips,omitempty"`
	DeploymentData    *string  `schema:"deployment_data,omitempty"`
	DeploymentHash    *string  `schema:"deployment_hash,omitempty"`
	FarmName          *string  `schema:"farm_name,omitempty"`
	FarmId            *uint64  `schema:"farm_id,omitempty"`
}

ContractFilter contract filters

type CpuBenchmark added in v0.16.10

type CpuBenchmark struct {
	NodeTwinId     uint32  `json:"node_twin_id,omitempty" gorm:"unique;not null"`
	SingleThreaded float64 `json:"single" gorm:"column:single_threaded"`
	MultiThreaded  float64 `json:"multi" gorm:"column:multi_threaded"`
	Threads        int     `json:"threads" gorm:"column:threads"`
	Workloads      int     `json:"workloads" gorm:"column:workloads"`
	UpdatedAt      int64   `json:"updated_at,omitempty" gorm:"column:updated_at"`
}

CpuBenchmark holds measures to the performance of the CPU for a node used as both gorm model and server json response

func (CpuBenchmark) TableName added in v0.16.10

func (CpuBenchmark) TableName() string

type Dmi added in v0.15.0

type Dmi struct {
	NodeTwinId uint32      `json:"node_twin_id,omitempty" gorm:"unique;not null"`
	BIOS       BIOS        `json:"bios" gorm:"type:jsonb;serializer:json"`
	Baseboard  Baseboard   `json:"baseboard" gorm:"type:jsonb;serializer:json"`
	Processor  []Processor `json:"processor" gorm:"type:jsonb;serializer:json"`
	Memory     []Memory    `json:"memory" gorm:"type:jsonb;serializer:json"`
	UpdatedAt  int64       `json:"updated_at,omitempty"`
}

Dmi holds hardware dmi info for a node used as both gorm model and server json response

func (Dmi) TableName added in v0.15.0

func (Dmi) TableName() string

type Farm

type Farm struct {
	Name              string     `json:"name" sort:"name"`
	FarmID            int        `json:"farmId" sort:"farm_id"`
	TwinID            int        `json:"twinId" sort:"twin_id"`
	PricingPolicyID   int        `json:"pricingPolicyId"`
	CertificationType string     `json:"certificationType"`
	StellarAddress    string     `json:"stellarAddress"`
	Dedicated         bool       `json:"dedicated" sort:"dedicated"`
	PublicIps         []PublicIP `json:"publicIps" sort:"public_ips"`
	// contains filtered or unexported fields
}

Farm info about the farm

type FarmFilter

type FarmFilter struct {
	FreeIPs           *uint64  `schema:"free_ips,omitempty"`
	TotalIPs          *uint64  `schema:"total_ips,omitempty"`
	StellarAddress    *string  `schema:"stellar_address,omitempty"`
	PricingPolicyID   *uint64  `schema:"pricing_policy_id,omitempty"`
	FarmID            *uint64  `schema:"farm_id,omitempty"`
	TwinID            *uint64  `schema:"twin_id,omitempty"`
	Name              *string  `schema:"name,omitempty"`
	NameContains      *string  `schema:"name_contains,omitempty"`
	CertificationType *string  `schema:"certification_type,omitempty"`
	Dedicated         *bool    `schema:"dedicated,omitempty"`
	NodeFreeMRU       *uint64  `schema:"node_free_mru,omitempty"`
	NodeFreeHRU       *uint64  `schema:"node_free_hru,omitempty"`
	NodeFreeSRU       *uint64  `schema:"node_free_sru,omitempty"`
	NodeTotalCRU      *uint64  `schema:"node_total_cru,omitempty"`
	NodeStatus        []string `schema:"node_status,omitempty"`
	NodeRentedBy      *uint64  `schema:"node_rented_by,omitempty"`
	NodeAvailableFor  *uint64  `schema:"node_available_for,omitempty"`
	NodeHasGPU        *bool    `schema:"node_has_gpu,omitempty"`
	NodeHasIpv6       *bool    `schema:"node_has_ipv6,omitempty"`
	NodeCertified     *bool    `schema:"node_certified,omitempty"`
	NodeFeatures      []string `schema:"node_features,omitempty"`
	Country           *string  `schema:"country,omitempty"`
	Region            *string  `schema:"region,omitempty"`
}

FarmFilter farm filters

func (FarmFilter) IsNodeFilterRequested added in v0.15.18

func (f FarmFilter) IsNodeFilterRequested() bool

func (FarmFilter) Validate added in v0.15.18

func (f FarmFilter) Validate() error

type HasIpv6 added in v0.15.1

type HasIpv6 struct {
	NodeTwinId uint32 `gorm:"unique;not null"`
	HasIpv6    bool
	UpdatedAt  int64
}

HasIpv6 holds the state of node having ipv6 used as gorm model

func (HasIpv6) TableName added in v0.15.1

func (HasIpv6) TableName() string

type Health added in v0.15.8

type Health struct {
	TotalStateOk bool          `json:"total_state_ok"`
	DBConn       string        `json:"db_conn"`
	RMBConn      string        `json:"rmb_conn"`
	Indexers     IndexersState `json:"indexers"`
}

Health represent the healthiness of the server and connections

type HealthReport added in v0.13.5

type HealthReport struct {
	NodeTwinId uint32 `gorm:"unique;not null"`
	Healthy    bool
	UpdatedAt  int64
}

HealthReport holds the state of node healthiness used as gorm model

func (HealthReport) TableName added in v0.15.0

func (HealthReport) TableName() string

type IndexerState added in v0.15.8

type IndexerState struct {
	UpdatedAt int64 `json:"updated_at"`
}

type IndexersState added in v0.15.8

type IndexersState struct {
	Gpu          IndexerState `json:"gpu"`
	Health       IndexerState `json:"health"`
	Dmi          IndexerState `json:"dmi"`
	Speed        IndexerState `json:"speed"`
	CpuBenchmark IndexerState `json:"cpu_benchmark"`
	Ipv6         IndexerState `json:"ipv6"`
	Workloads    IndexerState `json:"workloads"`
	Features     IndexerState `json:"features"`
}

type Limit

type Limit struct {
	Size      uint64    `schema:"size,omitempty"`
	Page      uint64    `schema:"page,omitempty"`
	RetCount  bool      `schema:"ret_count,omitempty"`
	Randomize bool      `schema:"randomize,omitempty"`
	SortBy    SortBy    `schema:"sort_by,omitempty"`
	SortOrder SortOrder `schema:"sort_order,omitempty"`
	Balance   float64   `schema:"balance,omitempty"`
}

Limit used for pagination

func DefaultLimit added in v0.11.8

func DefaultLimit() Limit

DefaultLimit returns the default values for the pagination

func (*Limit) Valid added in v0.11.8

func (l *Limit) Valid(typ interface{}) error

Valid validates the sorting values

type Location

type Location struct {
	Country   string   `json:"country"`
	City      string   `json:"city"`
	Region    string   `json:"region"`
	Longitude *float64 `json:"longitude"`
	Latitude  *float64 `json:"latitude"`
}

Location represent the geographic info about the node

type Memory added in v0.15.0

type Memory struct {
	Manufacturer string `json:"manufacturer"`
	Type         string `json:"type"`
}

type NameContractDetails

type NameContractDetails struct {
	Name string `json:"name"`
}

NameContractDetails name contract details

type Node

type Node struct {
	ID                string       `json:"id"`
	NodeID            int          `json:"nodeId" sort:"node_id"`
	FarmID            int          `json:"farmId" sort:"farm_id"`
	FarmName          string       `json:"farmName"`
	TwinID            int          `json:"twinId" sort:"twin_id"`
	Country           string       `json:"country" sort:"country"`
	GridVersion       int          `json:"gridVersion"`
	City              string       `json:"city" sort:"city"`
	Uptime            int64        `json:"uptime" sort:"uptime"`
	Created           int64        `json:"created" sort:"created"`
	FarmingPolicyID   int          `json:"farmingPolicyId"`
	UpdatedAt         int64        `json:"updatedAt" sort:"updated_at"`
	TotalResources    Capacity     `json:"total_resources" sort:"total_"`
	UsedResources     Capacity     `json:"used_resources" sort:"used_"`
	Location          Location     `json:"location"`
	PublicConfig      PublicConfig `json:"publicConfig"`
	Status            string       `json:"status" sort:"status"`
	CertificationType string       `json:"certificationType"`
	Dedicated         bool         `json:"dedicated"`
	InDedicatedFarm   bool         `json:"inDedicatedFarm" sort:"dedicated_farm"`
	RentContractID    uint         `json:"rentContractId" sort:"rent_contract_id"`
	Rented            bool         `json:"rented" sort:"rented"`
	Rentable          bool         `json:"rentable" sort:"rentable"`
	RentedByTwinID    uint         `json:"rentedByTwinId"`
	SerialNumber      string       `json:"serialNumber"`
	Power             NodePower    `json:"power"`
	NumGPU            int          `json:"num_gpu" sort:"num_gpu"`
	ExtraFee          uint64       `json:"extraFee" sort:"extra_fee"`
	Healthy           bool         `json:"healthy"`
	Dmi               Dmi          `json:"dmi"`
	Speed             Speed        `json:"speed"`
	CpuBenchmark      CpuBenchmark `json:"cpu_benchmark"`
	GPUs              []NodeGPU    `json:"gpus"`
	PriceUsd          float64      `json:"price_usd" sort:"price_usd"`
	FarmFreeIps       uint         `json:"farm_free_ips"`
	Features          []string     `json:"features"`
	// contains filtered or unexported fields
}

Node is a struct holding the data for a Node for the nodes view

type NodeContractDetails

type NodeContractDetails struct {
	NodeID            uint   `json:"nodeId"`
	DeploymentData    string `json:"deployment_data"`
	DeploymentHash    string `json:"deployment_hash"`
	NumberOfPublicIps uint   `json:"number_of_public_ips"`
	FarmName          string `json:"farm_name"`
	FarmId            uint64 `json:"farm_id"`
}

NodeContractDetails node contract details

type NodeFeatures added in v0.15.18

type NodeFeatures struct {
	NodeTwinId uint32   `json:"node_twin_id,omitempty" gorm:"unique;not null"`
	UpdatedAt  int64    `json:"updated_at,omitempty"`
	Features   []string `json:"features" gorm:"type:jsonb;serializer:json"`
}

func (NodeFeatures) TableName added in v0.15.18

func (NodeFeatures) TableName() string

type NodeFilter

type NodeFilter struct {
	Status             []string `schema:"status,omitempty"`
	FreeMRU            *uint64  `schema:"free_mru,omitempty"`
	FreeHRU            *uint64  `schema:"free_hru,omitempty"`
	FreeSRU            *uint64  `schema:"free_sru,omitempty"`
	TotalMRU           *uint64  `schema:"total_mru,omitempty"`
	TotalHRU           *uint64  `schema:"total_hru,omitempty"`
	TotalSRU           *uint64  `schema:"total_sru,omitempty"`
	TotalCRU           *uint64  `schema:"total_cru,omitempty"`
	Country            *string  `schema:"country,omitempty"`
	CountryContains    *string  `schema:"country_contains,omitempty"`
	City               *string  `schema:"city,omitempty"`
	CityContains       *string  `schema:"city_contains,omitempty"`
	Region             *string  `schema:"region,omitempty"`
	FarmName           *string  `schema:"farm_name,omitempty"`
	FarmNameContains   *string  `schema:"farm_name_contains,omitempty"`
	FarmIDs            []uint64 `schema:"farm_ids,omitempty"`
	FreeIPs            *uint64  `schema:"free_ips,omitempty"`
	IPv4               *bool    `schema:"ipv4,omitempty"`
	IPv6               *bool    `schema:"ipv6,omitempty"`
	Domain             *bool    `schema:"domain,omitempty"`
	Dedicated          *bool    `schema:"dedicated,omitempty"`
	InDedicatedFarm    *bool    `schema:"in_dedicated_farm,omitempty"`
	Rentable           *bool    `schema:"rentable,omitempty"`
	OwnedBy            *uint64  `schema:"owned_by,omitempty"`
	Rented             *bool    `schema:"rented,omitempty"`
	RentedBy           *uint64  `schema:"rented_by,omitempty"`
	RentableOrRentedBy *uint64  `schema:"rentable_or_rented_by,omitempty"` // rented by twin or rentable
	AvailableFor       *uint64  `schema:"available_for,omitempty"`         // rented by twin or free
	NodeID             *uint64  `schema:"node_id,omitempty"`
	NodeIDs            []uint64 `schema:"node_ids,omitempty"`
	TwinID             *uint64  `schema:"twin_id,omitempty"`
	CertificationType  *string  `schema:"certification_type,omitempty"`
	HasGPU             *bool    `schema:"has_gpu,omitempty"`
	NumGPU             *uint64  `schema:"num_gpu,omitempty"`
	GpuDeviceID        *string  `schema:"gpu_device_id,omitempty"`
	GpuDeviceName      *string  `schema:"gpu_device_name,omitempty"`
	GpuVendorID        *string  `schema:"gpu_vendor_id,omitempty"`
	GpuVendorName      *string  `schema:"gpu_vendor_name,omitempty"`
	GpuAvailable       *bool    `schema:"gpu_available,omitempty"`
	Healthy            *bool    `schema:"healthy,omitempty"`
	PriceMin           *float64 `schema:"price_min,omitempty"`
	PriceMax           *float64 `schema:"price_max,omitempty"`
	Excluded           []uint64 `schema:"excluded,omitempty"`
	HasIpv6            *bool    `schema:"has_ipv6,omitempty"`
	Features           []string `schema:"features,omitempty"`
}

NodeFilter node filters

func (NodeFilter) IsGpuFilterRequested added in v0.15.18

func (f NodeFilter) IsGpuFilterRequested() bool

func (NodeFilter) Validate added in v0.15.18

func (f NodeFilter) Validate() error

type NodeGPU

type NodeGPU struct {
	NodeTwinID uint32 `gorm:"uniqueIndex:uni_gpu_node_twin_id" json:"node_twin_id,omitempty" `
	ID         string `gorm:"uniqueIndex:uni_gpu_node_twin_id" json:"id"`
	Vendor     string `json:"vendor"`
	Device     string `json:"device"`
	Vram       uint64 `json:"vram"`
	Contract   int    `json:"contract"`
	UpdatedAt  int64  `json:"updated_at,omitempty"`
}

NodeGpu holds info for a node gpu used as both gorm model and server json response

func (NodeGPU) TableName added in v0.15.0

func (NodeGPU) TableName() string

type NodeLocation added in v0.16.5

type NodeLocation struct {
	Country   string `json:"country" gorm:"unique;not null"`
	Continent string `json:"continent"`
	UpdatedAt int64  `json:"updated_at"`
}

func (NodeLocation) TableName added in v0.16.5

func (NodeLocation) TableName() string

type NodePower

type NodePower struct {
	State  string `json:"state"`
	Target string `json:"target"`
}

NodePower struct is the farmerbot report for node status

type NodeStatistics

type NodeStatistics struct {
	System         NodeStatisticsResources `json:"system"`
	Total          NodeStatisticsResources `json:"total"`
	Used           NodeStatisticsResources `json:"used"`
	Users          NodeStatisticsUsers     `json:"users"`
	OpenConnecions uint                    `json:"open_connections"`
}

NodeStatistics node statistics info

type NodeStatisticsResources

type NodeStatisticsResources struct {
	CRU   int `json:"cru"`
	HRU   int `json:"hru"`
	IPV4U int `json:"ipv4u"`
	MRU   int `json:"mru"`
	SRU   int `json:"sru"`
}

NodeStatisticsResources resources returned on node statistics

type NodeStatisticsUsers

type NodeStatisticsUsers struct {
	Deployments             int    `json:"deployments"`
	Workloads               int    `json:"workloads"`
	LastDeploymentTimestamp uint64 `json:"last_deployment_timestamp"`
}

NodeStatisticsUsers users info returned on node statistics

type NodeStatus

type NodeStatus struct {
	Status string `json:"status"`
}

NodeStatus is used for status endpoint to decode json in

type NodeWithNestedCapacity

type NodeWithNestedCapacity struct {
	ID                string         `json:"id"`
	NodeID            int            `json:"nodeId"`
	FarmID            int            `json:"farmId"`
	FarmName          string         `json:"farmName"`
	TwinID            int            `json:"twinId"`
	Country           string         `json:"country"`
	GridVersion       int            `json:"gridVersion"`
	City              string         `json:"city"`
	Uptime            int64          `json:"uptime"`
	Created           int64          `json:"created"`
	FarmingPolicyID   int            `json:"farmingPolicyId"`
	UpdatedAt         int64          `json:"updatedAt"`
	Capacity          CapacityResult `json:"capacity"`
	Location          Location       `json:"location"`
	PublicConfig      PublicConfig   `json:"publicConfig"`
	Status            string         `json:"status"` // added node status field for up or down
	CertificationType string         `json:"certificationType"`
	Dedicated         bool           `json:"dedicated"`
	InDedicatedFarm   bool           `json:"inDedicatedFarm"`
	RentContractID    uint           `json:"rentContractId"`
	RentedByTwinID    uint           `json:"rentedByTwinId"`
	Rented            bool           `json:"rented"`
	Rentable          bool           `json:"rentable"`
	SerialNumber      string         `json:"serialNumber"`
	Power             NodePower      `json:"power"`
	NumGPU            int            `json:"num_gpu"`
	ExtraFee          uint64         `json:"extraFee"`
	Healthy           bool           `json:"healthy"`
	Dmi               Dmi            `json:"dmi"`
	Speed             Speed          `json:"speed"`
	CpuBenchmark      CpuBenchmark   `json:"cpu_benchmark"`
	GPUs              []NodeGPU      `json:"gpus"`
	PriceUsd          float64        `json:"price_usd"`
	FarmFreeIps       uint           `json:"farm_free_ips"`
	Features          []string       `json:"features"`
}

Node to be compatible with old view

type NodesWorkloads added in v0.15.3

type NodesWorkloads struct {
	NodeTwinId      uint32 `json:"node_twin_id,omitempty" gorm:"unique;not null"`
	WorkloadsNumber uint32 `json:"workloads_number"`
	UpdatedAt       int64
}

NodesWorkloads holds the number of workloads on a node

func (NodesWorkloads) TableName added in v0.15.3

func (NodesWorkloads) TableName() string

type Processor added in v0.15.0

type Processor struct {
	Version     string `json:"version"`
	ThreadCount string `json:"thread_count"`
}

type PublicConfig

type PublicConfig struct {
	Domain string `json:"domain"`
	Gw4    string `json:"gw4"`
	Gw6    string `json:"gw6"`
	Ipv4   string `json:"ipv4"`
	Ipv6   string `json:"ipv6"`
}

PublicConfig node public config

type PublicIP

type PublicIP struct {
	ID         string `json:"id"`
	IP         string `json:"ip" sort:"ip"`
	Gateway    string `json:"gateway"`
	ContractID uint64 `json:"contract_id" sort:"contract_id"`
	FarmID     uint64 `json:"farm_id,omitempty" sort:"farm_id"`
}

PublicIP info about public ip in the farm

type PublicIpFilter added in v0.15.17

type PublicIpFilter struct {
	FarmIDs []uint64 `schema:"farm_ids,omitempty"`
	Free    *bool    `schema:"free,omitempty"`
	Ip      *string  `schema:"ip,omitempty"`
	Gateway *string  `schema:"gateway,omitempty"`
}

type RawContract added in v0.11.3

type RawContract struct {
	ContractID uint            `json:"contract_id"`
	TwinID     uint            `json:"twin_id"`
	State      string          `json:"state"`
	CreatedAt  uint            `json:"created_at"`
	Type       string          `json:"type"`
	Details    json.RawMessage `json:"details"`
}

RawContract represents a contract and its details in json RawMessage before decoding.

type RentContractDetails

type RentContractDetails struct {
	NodeID   uint   `json:"nodeId"`
	FarmName string `json:"farm_name"`
	FarmId   uint64 `json:"farm_id"`
}

RentContractDetails rent contract details

type SortBy added in v0.11.8

type SortBy string

SortBy is the sorted by field

type SortOrder added in v0.11.8

type SortOrder string

SortOrder is the direction of sorting

const (
	SortOrderAsc  SortOrder = "ASC"
	SortOrderDesc SortOrder = "DESC"
)

type Speed added in v0.15.0

type Speed struct {
	NodeTwinId      uint32  `json:"node_twin_id,omitempty" gorm:"unique;not null;column:node_twin_id"`
	Upload          float64 `json:"upload" gorm:"column:upload"`                       // in bit/sec let's suppose default is ipv4/tcp
	Download        float64 `json:"download" gorm:"column:download"`                   // in bit/sec
	UDPDownloadIPv4 float64 `json:"udp_download_ipv4" gorm:"column:udp_download_ipv4"` // in bit/sec
	UDPUploadIPv4   float64 `json:"udp_upload_ipv4" gorm:"column:udp_upload_ipv4"`     // in bit/sec
	TCPDownloadIPv6 float64 `json:"tcp_download_ipv6" gorm:"column:tcp_download_ipv6"` // in bit/sec
	TCPUploadIPv6   float64 `json:"tcp_upload_ipv6" gorm:"column:tcp_upload_ipv6"`     // in bit/sec
	UDPDownloadIPv6 float64 `json:"udp_download_ipv6" gorm:"column:udp_download_ipv6"` // in bit/sec
	UDPUploadIPv6   float64 `json:"udp_upload_ipv6" gorm:"column:udp_upload_ipv6"`     // in bit/sec
	UpdatedAt       int64   `json:"updated_at,omitempty" gorm:"column:updated_at"`
}

Speed holds upload/download speeds in `bit/sec` for a node used as both gorm model and server json response

func (Speed) TableName added in v0.15.0

func (Speed) TableName() string

type Stats added in v0.11.5

type Stats struct {
	Nodes             int64            `json:"nodes"`
	Farms             int64            `json:"farms"`
	Countries         int64            `json:"countries"`
	TotalCRU          int64            `json:"totalCru"`
	TotalSRU          int64            `json:"totalSru"`
	TotalMRU          int64            `json:"totalMru"`
	TotalHRU          int64            `json:"totalHru"`
	PublicIPs         int64            `json:"publicIps"`
	AccessNodes       int64            `json:"accessNodes"`
	Gateways          int64            `json:"gateways"`
	Twins             int64            `json:"twins"`
	Contracts         int64            `json:"contracts"`
	NodesDistribution map[string]int64 `json:"nodesDistribution" gorm:"-:all"`
	GPUs              int64            `json:"gpus"`
	DedicatedNodes    int64            `json:"dedicatedNodes"`
	WorkloadsNumber   uint32           `json:"workloads_number"`
}

Stats contains aggregate info about the grid

type StatsFilter

type StatsFilter struct {
	Status []string `schema:"status,omitempty"`
}

StatsFilter statistics filters

type Twin

type Twin struct {
	TwinID    uint   `json:"twinId" sort:"twin_id"`
	AccountID string `json:"accountId" sort:"account_id"`
	Relay     string `json:"relay" sort:"relay"`
	PublicKey string `json:"publicKey" sort:"public_key"`
}

Twin is the twin info

type TwinConsumption added in v0.15.6

type TwinConsumption struct {
	LastHourConsumption float64 `json:"last_hour_consumption"`
	OverallConsumption  float64 `json:"overall_consumption"`
}

TwinConsumption show a report of user spent in TFT

type TwinFilter

type TwinFilter struct {
	TwinID    *uint64 `schema:"twin_id,omitempty"`
	AccountID *string `schema:"account_id,omitempty"`
	Relay     *string `schema:"relay,omitempty"`
	PublicKey *string `schema:"public_key,omitempty"`
}

TwinFilter twin filters

type Version

type Version struct {
	Version string `json:"version"`
}

Version represent the deployed version of gridproxy

Jump to

Keyboard shortcuts

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