constructors_common

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2019 License: MIT Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LargerMin = xrr.Xrror("Min cannot be greater than max.")
View Source
var Unreachable = xrr.Xrror("weighted choices error: unreachable")

Functions

func AlphaOrdered

func AlphaOrdered() feature.Constructor

func CollectionMember

func CollectionMember() feature.Constructor

func CollectionMemberIndexed

func CollectionMemberIndexed() feature.Constructor

func CombinationStrings

func CombinationStrings() feature.Constructor

func Combinations

func Combinations(list Replacer, selectNum int, repeatable bool, buf int) (c chan Replacer)

func Default

func Default() feature.Constructor

the default constructor

func List

func List() feature.Constructor

func ListExpand

func ListExpand() feature.Constructor

func ListExpandIntRange

func ListExpandIntRange() feature.Constructor

func ListMirrorInts

func ListMirrorInts() feature.Constructor

func ListShuffle

func ListShuffle() feature.Constructor

func ListWithNull

func ListWithNull() feature.Constructor

func RoundRobin

func RoundRobin() feature.Constructor

func Set

func Set() feature.Constructor

A set constructor that takes provided keys and links them to multiple features in a return map.

func SimpleRandom

func SimpleRandom() feature.Constructor

func SourcedRandom

func SourcedRandom() feature.Constructor

func WeightedStringWithNormalizedWeights

func WeightedStringWithNormalizedWeights() feature.Constructor

func WeightedStringWithWeights

func WeightedStringWithWeights() feature.Constructor

Types

type Choice

type Choice struct {
	Weight int
	Value  interface{}
}

func SplitStringChoice

func SplitStringChoice(s string) *Choice

type Choices

type Choices interface {
	Choose() (*Choice, error)
}

func SplitStringChoices

func SplitStringChoices(s []string) Choices

type Registerable

type Registerable func() feature.Constructor

type Registerables

type Registerables struct {
	// contains filtered or unexported fields
}

func (*Registerables) Register

func (r *Registerables) Register() error

type Replacer

type Replacer interface {
	Len() int
	Replace([]int) Replacer
	Value() string
	ValueNoSame() (string, bool)
}

type StringReplacer

type StringReplacer []string

func (StringReplacer) Len

func (sl StringReplacer) Len() int

func (StringReplacer) Replace

func (sl StringReplacer) Replace(indices []int) Replacer

func (StringReplacer) Value

func (sl StringReplacer) Value() string

func (StringReplacer) ValueNoSame

func (sl StringReplacer) ValueNoSame() (string, bool)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL