github.com/walkingsparrow/docker@v1.4.2-0.20151218153551-b708a2249bfa/pkg/blkiodev/blkiodev.go (about)

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