github.com/haraldrudell/parl@v0.4.176/counter/rate-type.go (about)

     1  /*
     2  © 2022–present Harald Rudell <harald.rudell@gmail.com> (https://haraldrudell.github.io/haraldrudell/)
     3  ISC License
     4  */
     5  
     6  package counter
     7  
     8  import (
     9  	"github.com/haraldrudell/parl"
    10  	"github.com/haraldrudell/parl/sets"
    11  )
    12  
    13  type RateType parl.RateType
    14  
    15  func (rt RateType) String() (s string) {
    16  	return rateSet.StringT(rt)
    17  }
    18  
    19  var rateSet = sets.NewSet[RateType]([]sets.SetElement[RateType]{
    20  	{ValueV: RateType(parl.ValueRate), Name: "value rate"},
    21  	{ValueV: RateType(parl.ValueMaxRate), Name: "value max rate"},
    22  	{ValueV: RateType(parl.RunningRate), Name: "running inc rate"},
    23  	{ValueV: RateType(parl.RunningMaxRate), Name: "runninc max inc rate"},
    24  	{ValueV: RateType(parl.RunningMaxDecRate), Name: "running max dec rate"},
    25  })