directory

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2022 License: Apache-2.0 Imports: 5 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Farm

type Farm struct {
	ID                  schema.ID           `bson:"_id" json:"id"`
	ThreebotID          int64               `bson:"threebot_id" json:"threebot_id"`
	IyoOrganization     string              `bson:"iyo_organization" json:"iyo_organization"`
	Name                string              `bson:"name" json:"name"`
	WalletAddresses     []WalletAddress     `bson:"wallet_addresses" json:"wallet_addresses"`
	Location            Location            `bson:"location" json:"location"`
	Email               schema.Email        `bson:"email" json:"email"`
	ResourcePrices      []NodeResourcePrice `bson:"resource_prices" json:"resource_prices"`
	PrefixZero          schema.IPRange      `bson:"prefix_zero" json:"prefix_zero"`
	IPAddresses         []PublicIP          `bson:"ipaddresses" json:"ipaddresses"`
	EnableCustomPricing bool                `bson:"enable_custom_pricing" json:"enable_custom_pricing"`
	FarmCloudUnitsPrice NodeCloudUnitPrice  `bson:"farm_cloudunits_price" json:"farm_cloudunits_price"`

	// Grid3 pricing enabled
	IsGrid3Compliant bool `bson:"is_grid3_compliant" json:"is_grid3_compliant"`
}

func NewFarm

func NewFarm() (Farm, error)

type FarmThreebotPrice added in v0.5.0

type FarmThreebotPrice struct {
	ThreebotID           int64              `bson:"threebot_id" json:"threebot_id"`
	FarmID               int64              `bson:"farm_id" json:"farm_id"`
	CustomCloudUnitPrice NodeCloudUnitPrice `bson:"custom_cloudunits_price" json:"custom_cloudunits_price"`
}

type Gateway

type Gateway struct {
	ID             schema.ID      `bson:"_id" json:"id"`
	NodeId         string         `bson:"node_id" json:"node_id"`
	FarmId         int64          `bson:"farm_id" json:"farm_id"`
	OsVersion      string         `bson:"os_version" json:"os_version"`
	Created        schema.Date    `bson:"created" json:"created"`
	Updated        schema.Date    `bson:"updated" json:"updated"`
	Uptime         int64          `bson:"uptime" json:"uptime"`
	Address        string         `bson:"address" json:"address"`
	Location       Location       `bson:"location" json:"location"`
	PublicKeyHex   string         `bson:"public_key_hex" json:"public_key_hex"`
	Workloads      WorkloadAmount `bson:"workloads" json:"workloads"`
	ManagedDomains []string       `bson:"managed_domains" json:"managed_domains"`
	TcpRouterPort  int64          `bson:"tcp_router_port" json:"tcp_router_port"`
	DnsNameserver  []string       `bson:"dns_nameserver" json:"dns_nameserver"`
	FreeToUse      bool           `bson:"free_to_use" json:"free_to_use"`
}

type Iface

type Iface struct {
	Name       string            `bson:"name" json:"name"`
	Addrs      []schema.IPRange  `bson:"addrs" json:"addrs"`
	Gateway    []net.IP          `bson:"gateway" json:"gateway"`
	MacAddress schema.MacAddress `bson:"macaddress" json:"macaddress"`
}

func NewIface

func NewIface() (Iface, error)

type IfaceTypeEnum

type IfaceTypeEnum uint8
const (
	IfaceTypeMacvlan IfaceTypeEnum = iota
	IfaceTypeVlan
)

func (IfaceTypeEnum) String

func (e IfaceTypeEnum) String() string

type Location

type Location struct {
	City      string  `bson:"city" json:"city"`
	Country   string  `bson:"country" json:"country"`
	Continent string  `bson:"continent" json:"continent"`
	Latitude  float64 `bson:"latitude" json:"latitude"`
	Longitude float64 `bson:"longitude" json:"longitude"`
}

func NewLocation

func NewLocation() (Location, error)

type Node

type Node struct {
	ID                schema.ID      `bson:"_id" json:"id"`
	NodeId            string         `bson:"node_id" json:"node_id"`
	HostName          string         `bson:"hostname" json:"hostname"`
	NodeIdV1          string         `bson:"node_id_v1" json:"node_id_v1"`
	FarmId            int64          `bson:"farm_id" json:"farm_id"`
	OsVersion         string         `bson:"os_version" json:"os_version"`
	Created           schema.Date    `bson:"created" json:"created"`
	Updated           schema.Date    `bson:"updated" json:"updated"`
	Uptime            int64          `bson:"uptime" json:"uptime"`
	Address           string         `bson:"address" json:"address"`
	Location          Location       `bson:"location" json:"location"`
	TotalResources    ResourceAmount `bson:"total_resources" json:"total_resources"`
	UsedResources     ResourceAmount `bson:"used_resources" json:"used_resources"`
	ReservedResources ResourceAmount `bson:"reserved_resources" json:"reserved_resources"`
	Workloads         WorkloadAmount `bson:"workloads" json:"workloads"`
	Proofs            []Proof        `bson:"proofs" json:"proofs"`
	Ifaces            []Iface        `bson:"ifaces" json:"ifaces"`
	PublicConfig      *PublicIface   `bson:"public_config,omitempty" json:"public_config"`
	FreeToUse         bool           `bson:"free_to_use" json:"free_to_use"`
	Approved          bool           `bson:"approved" json:"approved"`
	PublicKeyHex      string         `bson:"public_key_hex" json:"public_key_hex"`
	WgPorts           []int64        `bson:"wg_ports" json:"wg_ports"`
	Deleted           bool           `bson:"deleted" json:"deleted"`
	Reserved          bool           `bson:"reserved" json:"reserved"`
}

func NewNode

func NewNode() (Node, error)

type NodeCloudUnitPrice added in v0.5.0

type NodeCloudUnitPrice struct {
	Currency PriceCurrencyEnum `bson:"currency" json:"currency"`
	CU       float64           `bson:"cu" json:"cu"`
	SU       float64           `bson:"su" json:"su"`
	NU       float64           `bson:"nu" json:"nu"`
	IPv4U    float64           `bson:"ipv4u" json:"ipv4u"`
}

func NewNodeCloudUnitPrice added in v0.5.0

func NewNodeCloudUnitPrice() NodeCloudUnitPrice

type NodeResourcePrice

type NodeResourcePrice struct {
	Currency PriceCurrencyEnum `bson:"currency" json:"currency"`
	Cru      float64           `bson:"cru" json:"cru"`
	Mru      float64           `bson:"mru" json:"mru"`
	Hru      float64           `bson:"hru" json:"hru"`
	Sru      float64           `bson:"sru" json:"sru"`
	Nru      float64           `bson:"nru" json:"nru"`
}

func NewNodeResourcePrice

func NewNodeResourcePrice() (NodeResourcePrice, error)

type PriceCurrencyEnum

type PriceCurrencyEnum uint8
const (
	PriceCurrencyEUR PriceCurrencyEnum = iota
	PriceCurrencyUSD
	PriceCurrencyTFT
	PriceCurrencyAED
	PriceCurrencyGBP
)

func (PriceCurrencyEnum) String

func (e PriceCurrencyEnum) String() string

type Proof

type Proof struct {
	Created      schema.Date            `bson:"created" json:"created"`
	HardwareHash string                 `bson:"hardware_hash" json:"hardware_hash"`
	DiskHash     string                 `bson:"disk_hash" json:"disk_hash"`
	Hardware     map[string]interface{} `bson:"hardware" json:"hardware"`
	Disks        map[string]interface{} `bson:"disks" json:"disks"`
	Hypervisor   []string               `bson:"hypervisor" json:"hypervisor"`
}

func NewProof

func NewProof() (Proof, error)

type PublicIP added in v0.4.8

type PublicIP struct {
	Address       schema.IPCidr `bson:"address" json:"address"`
	Gateway       schema.IP     `bson:"gateway" json:"gateway"`
	ReservationID schema.ID     `bson:"reservation_id" json:"reservation_id"`
}

PublicIP structure

func (*PublicIP) Valid added in v0.4.8

func (ip *PublicIP) Valid() error

type PublicIface

type PublicIface struct {
	Master  string         `bson:"master" json:"master"`
	Type    IfaceTypeEnum  `bson:"type" json:"type"`
	Ipv4    schema.IPRange `bson:"ipv4" json:"ipv4"`
	Ipv6    schema.IPRange `bson:"ipv6" json:"ipv6"`
	Gw4     net.IP         `bson:"gw4" json:"gw4"`
	Gw6     net.IP         `bson:"gw6" json:"gw6"`
	Version int64          `bson:"version" json:"version"`
}

func (PublicIface) Validate

func (p PublicIface) Validate() error

Validate check if all the value of the object are valid

type ResourceAmount

type ResourceAmount struct {
	Cru uint64  `bson:"cru" json:"cru"`
	Mru float64 `bson:"mru" json:"mru"`
	Hru float64 `bson:"hru" json:"hru"`
	Sru float64 `bson:"sru" json:"sru"`
}

func NewResourceAmount

func NewResourceAmount() (ResourceAmount, error)

func (*ResourceAmount) Diff added in v0.6.0

Diff returns r - v

type WalletAddress

type WalletAddress = phonebook.WalletAddress

type WorkloadAmount

type WorkloadAmount struct {
	Network         uint16 `bson:"network" json:"network"`
	NetworkResource uint16 `bson:"network_resource" json:"network_resource"`
	Volume          uint16 `bson:"volume" json:"volume"`
	ZDBNamespace    uint16 `bson:"zdb_namespace" json:"zdb_namespace"`
	Container       uint16 `bson:"container" json:"container"`
	K8sVM           uint16 `bson:"k8s_vm" json:"k8s_vm"`
	GenericVM       uint16 `bson:"generic_vm" json:"generic_vm"`
	Proxy           uint16 `bson:"proxy" json:"proxy"`
	ReverseProxy    uint16 `bson:"reverse_proxy" json:"reverse_proxy"`
	Subdomain       uint16 `bson:"subdomain" json:"subdomain"`
	DelegateDomain  uint16 `bson:"delegate_domain" json:"delegate_domain"`
}

Jump to

Keyboard shortcuts

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