ceremonyclient/pebble/internal/randvar/randvar.go

26 lines
698 B
Go
Raw Permalink Normal View History

2024-01-03 07:31:42 +00:00
// Copyright 2019 The LevelDB-Go and Pebble Authors. All rights reserved. Use
// of this source code is governed by a BSD-style license that can be found in
// the LICENSE file.
package randvar
import "golang.org/x/exp/rand"
// Static models a random variable that pulls from a distribution with static
// bounds
type Static interface {
Uint64(rng *rand.Rand) uint64
}
// Dynamic models a random variable that pulls from a distribution with an
// upper bound that can change dynamically using the IncMax method.
type Dynamic interface {
Static
// Increment the max value the variable will return.
IncMax(delta int)
// Read the current max value the variable will return.
Max() uint64
}