github.com/MetalBlockchain/metalgo@v1.11.9/utils/resource/no_usage.go (about)

     1  // Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved.
     2  // See the file LICENSE for licensing terms.
     3  
     4  package resource
     5  
     6  import "math"
     7  
     8  // NoUsage implements Usage() by always returning 0.
     9  var NoUsage User = noUsage{}
    10  
    11  type noUsage struct{}
    12  
    13  func (noUsage) CPUUsage() float64 {
    14  	return 0
    15  }
    16  
    17  func (noUsage) DiskUsage() (float64, float64) {
    18  	return 0, 0
    19  }
    20  
    21  func (noUsage) AvailableDiskBytes() uint64 {
    22  	return math.MaxUint64
    23  }