light modification
This commit is contained in:
parent
367613a9d5
commit
d00109daf3
@ -9,15 +9,6 @@ import (
|
||||
"cloud.o-forge.io/core/oc-lib/tools"
|
||||
)
|
||||
|
||||
// enum of public private or licenced data
|
||||
type DataLicense int
|
||||
|
||||
const (
|
||||
PUBLIC DataLicense = iota
|
||||
PRIVATE
|
||||
LICENCED
|
||||
)
|
||||
|
||||
/*
|
||||
* DataResource is a struct that represents a data resource
|
||||
* it defines the resource data
|
||||
@ -70,6 +61,14 @@ const (
|
||||
PER_KB_DOWNLOADED
|
||||
)
|
||||
|
||||
func (t DataResourcePricingStrategy) String() string {
|
||||
return [...]string{"PER DOWNLOAD", "PER TB DOWNLOADED", "PER GB DOWNLOADED", "PER MB DOWNLOADED", "PER KB DOWNLOADED"}[t]
|
||||
}
|
||||
|
||||
func DataResourcePricingStrategyList() []DataResourcePricingStrategy {
|
||||
return []DataResourcePricingStrategy{PER_DOWNLOAD, PER_TB_DOWNLOADED, PER_GB_DOWNLOADED, PER_MB_DOWNLOADED, PER_KB_DOWNLOADED}
|
||||
}
|
||||
|
||||
func ToDataResourcePricingStrategy(i int) DataResourcePricingStrategy {
|
||||
return DataResourcePricingStrategy(i)
|
||||
}
|
||||
|
@ -66,8 +66,12 @@ const (
|
||||
GARANTED_STORAGE
|
||||
)
|
||||
|
||||
func PrivilegeStoragePricingStrategyList() []PrivilegeStoragePricingStrategy {
|
||||
return []PrivilegeStoragePricingStrategy{BASIC_STORAGE, GARANTED_ON_DELAY_STORAGE, GARANTED_STORAGE}
|
||||
}
|
||||
|
||||
func (t PrivilegeStoragePricingStrategy) String() string {
|
||||
return [...]string{"BASIC_STORAGE", "GARANTED_ON_DELAY_STORAGE", "GARANTED_STORAGE"}[t]
|
||||
return [...]string{"NO MEMORY HOLDING", "KEEPED ON MEMORY GARANTED DURING DELAY", "KEEPED ON MEMORY GARANTED"}[t]
|
||||
}
|
||||
|
||||
type StorageResourcePricingStrategy int
|
||||
@ -80,6 +84,14 @@ const (
|
||||
PER_KB_STORED
|
||||
)
|
||||
|
||||
func StorageResourcePricingStrategyList() []StorageResourcePricingStrategy {
|
||||
return []StorageResourcePricingStrategy{PER_DATA_STORED, PER_TB_STORED, PER_GB_STORED, PER_MB_STORED, PER_KB_STORED}
|
||||
}
|
||||
|
||||
func (t StorageResourcePricingStrategy) String() string {
|
||||
return [...]string{"PER DATA STORED", "PER TB STORED", "PER GB STORED", "PER MB STORED", "PER KB STORED"}[t]
|
||||
}
|
||||
|
||||
func (t StorageResourcePricingStrategy) GetStrategy() string {
|
||||
return [...]string{"PER_DATA_STORED", "PER_GB_STORED", "PER_MB_STORED", "PER_KB_STORED"}[t]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user