Skip to content

threefold.grid4.cloudslices #

fn load #

fn load(path string) ![]Node

load the cloudboxes from a path

fn play #

fn play(mut plbook PlayBook) !map[string]&Node

this play script should never be called from hero directly its called by gridsimulator

fn preprocess_value #

fn preprocess_value(v string) string

struct AIBox #

struct AIBox {
pub mut:
	amount           int
	gpu_brand        string
	gpu_version      string
	description      string
	storage_gb       f64
	passmark         int
	vcores           int
	mem_gb           f64
	mem_gb_gpu       f64
	price_range      []f64 = [0.0, 0.0]
	price_simulation f64
	hdd_nr           int
	ssd_nr           int
}

struct CloudBox #

struct CloudBox {
pub mut:
	amount           int
	description      string
	storage_gb       f64
	passmark         int
	vcores           int
	mem_gb           f64
	price_range      []f64 = [0.0, 0.0]
	price_simulation f64
	ssd_nr           int
}

struct Node #

struct Node {
pub mut:
	id           int
	name         string
	cost         f64
	deliverytime time.Time
	description  string
	cpu_brand    string
	cpu_version  string
	inca_reward  int
	image        string
	mem          string
	hdd          string
	ssd          string
	url          string
	reputation   int
	uptime       int
	continent    string
	country      string
	passmark     int
	cloudbox     []CloudBox
	aibox        []AIBox
	storagebox   []StorageBox
	vendor       string
	grant        NodeGrant
}

fn (Node) node_total #

fn (n Node) node_total() NodeTotal

fn (Node) preprocess_location #

fn (mut n Node) preprocess_location(v string) !

struct NodeGrant #

struct NodeGrant {
pub mut:
	grant_month_usd   string
	grant_month_inca  string
	grant_max_nrnodes int
}

struct NodeTotal #

struct NodeTotal {
pub mut:
	id           int
	name         string
	cost         f64
	deliverytime time.Time
	description  string
	cpu_brand    string
	cpu_version  string
	inca_reward  int
	image        string
	mem          string
	hdd          string
	ssd          string
	url          string
	reputation   int
	uptime       int
	continent    string
	country      string

	storage_gb       f64
	mem_gb           f64
	mem_gb_gpu       f64
	price_simulation f64
	passmark         int
	vcores           int
}

struct StorageBox #

struct StorageBox {
pub mut:
	amount           int
	description      string
	price_range      []f64 = [0.0, 0.0]
	price_simulation f64
}