github.com/zhuohuang-hust/src-cbuild@v0.0.0-20230105071821-c7aab3e7c840/api/types/blkiodev/blkio.go (about)

     1  package blkiodev
     2  
     3  import "fmt"
     4  
     5  // WeightDevice is a structure that holds device:weight pair
     6  type WeightDevice struct {
     7  	Path   string
     8  	Weight uint16
     9  }
    10  
    11  func (w *WeightDevice) String() string {
    12  	return fmt.Sprintf("%s:%d", w.Path, w.Weight)
    13  }
    14  
    15  // ThrottleDevice is a structure that holds device:rate_per_second pair
    16  type ThrottleDevice struct {
    17  	Path string
    18  	Rate uint64
    19  }
    20  
    21  func (t *ThrottleDevice) String() string {
    22  	return fmt.Sprintf("%s:%d", t.Path, t.Rate)
    23  }