bulk

package
v0.0.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FCoalgebra

type FCoalgebra func([]string) string

FCoalgebra is one JSON node builder. F-coalgeras accepting zero amount of childs are primitive JSONs (constructors) arbitrary F-coalgebra may constructs JSON with N childs passed as strings if it unable to do it, it should panic

type GenerationRules

type GenerationRules map[uint][]FCoalgebra

GenerationRules is just a map of child count to F-coalgebras which accepts that count of childs you should care about arity of F-coalgebras

var (
	// see example of default generation rules
	DefaultGenerationRules GenerationRules = map[uint][]FCoalgebra{
		0: {numberConstructor, stringConstructor, arrayConstructor},
		1: {fCoalgebraJSONA, fCoalgebraJSONB, arrayConstructor},
		2: {fCoalgebraJSONC, arrayConstructor},
		3: {arrayConstructor},
	}

	// this rules do not generate collisions like 0 == "0"
	WithoutCollisionGenerationRules GenerationRules = map[uint][]FCoalgebra{
		0: {numberConstructor, arrayConstructor},
		1: {fCoalgebraJSONB, arrayConstructor},
		2: {fCoalgebraJSONC, arrayConstructor},
		3: {arrayConstructor},
	}
)

type JSONGenerator

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

func NewJSONGenerator

func NewJSONGenerator(generationRules GenerationRules) *JSONGenerator

NewJSONGenerator creates JSONGenerator with generation rules if generationRules rules are nil, default will be used

Jump to

Keyboard shortcuts

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