generator

package
v0.0.0-...-f6c4652 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssignPoolGoT

func AssignPoolGoT(g *Generator)

func IDFrom

func IDFrom(seed string) string

IDFrom generates a UUID according to RFC 4122 based off a seed.

Types

type Generator

type Generator struct {
	Services        Services
	ClassPoolOffset int
	ClassPool       Pool
	DescriptionPool Pool
	PlanPool        Pool
	TagPool         Pool
	MetadataPool    Pool
	RequiresPool    Pool
}

generator holds the parameters for generated responses.

func CreateGenerator

func CreateGenerator(serviceCount int, params Parameters) *Generator

func (*Generator) GetCatalog

func (g *Generator) GetCatalog() (*v2.CatalogResponse, error)

GetCatalog will produce a valid GetCatalog response based on the generator settings.

type Parameters

type Parameters struct {
	Seed     int64
	Services ServiceRanges
	Plans    PlanRanges
}

type Plan

type Plan struct {
	FromPool Pull
}

type PlanRanges

type PlanRanges struct {
	Metadata int
	Bindable int
	Free     int
}

type Plans

type Plans []Plan

type Pool

type Pool []string

type Property

type Property string
const (
	Tags                 Property = "tags"
	Metadata             Property = "metadata"
	Requires             Property = "Requires"
	Bindable             Property = "bindable"
	InstancesRetrievable Property = "instances_retrievable"
	BindingsRetrievable  Property = "bindings_retrievable"
	Free                 Property = "free"
)

type Pull

type Pull map[Property]int

type Service

type Service struct {
	FromPool Pull
	Plans    Plans
}

type ServiceRanges

type ServiceRanges struct {
	// Plans will default to 1. Range will be [1-Plans)
	Plans                int
	Tags                 int
	Metadata             int
	Requires             int
	Bindable             int
	InstancesRetrievable int
	BindingsRetrievable  int
}

type Services

type Services []Service

Jump to

Keyboard shortcuts

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