traefik/vendor/github.com/sacloud/libsacloud/sacloud/prop_memory.go
Ludovic Fernandez 139f280f35 ACME TLS ALPN
2018-07-03 12:44:04 +02:00

19 lines
399 B
Go

package sacloud
// propMemoryMB サイズ(MB)内包型
type propMemoryMB struct {
MemoryMB int `json:",omitempty"` // サイズ(MB単位)
}
// GetMemoryMB サイズ(MB単位) 取得
func (p *propMemoryMB) GetMemoryMB() int {
return p.MemoryMB
}
// GetMemoryGB サイズ(GB単位) 取得
func (p *propMemoryMB) GetMemoryGB() int {
if p.MemoryMB <= 0 {
return 0
}
return p.MemoryMB / 1024
}