Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractConstants ¶
ExtractConstants takes an interface which should be a Go language struct with "chain" Struct Tags, and extracts a map of names to indices in the generated vm struct
func ToValue ¶
ToValue returns a Go value as a VM value, including if the Go value is a struct or array. Structs may be nested. Struct fields with missing or empty `chain:` tags are skipped. Arrays create a list of values in the array
func ToValueScalar ¶
ToValueScalar converts a scalar value to a VM Value object it handles ints of several types, bool, string, time.Time, and pointers to these.
Types ¶
type SeededRand ¶
type SeededRand struct {
// contains filtered or unexported fields
}
SeededRand is a random number generator that conforms to Randomer. It accepts a seed at initialization and generates a predictable sequence thereafter.
func NewSeededRand ¶
func NewSeededRand(ba []byte) (*SeededRand, error)
NewSeededRand returns a new instance of a SeededRand.
func (*SeededRand) RandInt ¶
func (sr *SeededRand) RandInt() (int64, error)
RandInt implements Randomer for SeededRand.
func (*SeededRand) Seed ¶
func (sr *SeededRand) Seed(seed int64)
Seed sets the seed for the current SeededRand object. Note that seeding is expensive; doing NewSeededRand takes only a tiny amount longer than reseeding an existing random number generator.