Documentation ¶
Index ¶
- Variables
- func ChangeField(dist interface{}, fn string, fv interface{}) bool
- func ParseDuration(s string) (time.Duration, error)
- func ParseFloatRange(s string) (float64, float64, bool, bool)
- func ParseIntRange(s string) (int64, int64, bool, bool)
- func ParseUintRange(s string) (uint64, uint64, bool, bool)
- func ShowSilenceError(v bool)
- func Silence(fn func())
- func Stacks(v interface{}, skip int, size int) string
- func StrSliceContains(ss []string, s string) bool
- type SingleflightGroup
Constants ¶
This section is empty.
Variables ¶
var ErrRetryAfter = errors.New("sha.groupcache: retry after")
var ErrorStatusByValue = map[error]int{}
var RbacInited = false
Functions ¶
func ChangeField ¶ added in v0.0.6
func ParseDuration ¶
ParseDuration parses a duration string. A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as "300ms", "-1.5h" or "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h", "d", "w".
func ParseIntRange ¶
0-10: [0, 10] 0: [0,0] 0-: [0,) -10: (,10]
func ShowSilenceError ¶ added in v0.0.5
func ShowSilenceError(v bool)
func StrSliceContains ¶
Types ¶
type SingleflightGroup ¶
type SingleflightGroup struct {
// contains filtered or unexported fields
}
SingleflightGroup represents a class of work and forms a namespace in which units of work can be executed with duplicate suppression.
func NewSingleflightGroup ¶
func NewSingleflightGroup(maxWait int32) *SingleflightGroup
func (*SingleflightGroup) Do ¶
func (g *SingleflightGroup) Do(key string, fn func() (interface{}, error)) (interface{}, error)
Do executes and returns the results of the given function, making sure that only one execution is in-flight for a given key at a time. If a duplicate comes in, the duplicate caller waits for the original to complete and receives the same results.