generators

package
v0.0.0-...-3f0bb5d Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

type Field struct {
	Table string
	Name  string
}

type FieldGenerator

type FieldGenerator interface {
	GetInt() int64

	GetText() string

	GetDescription() string

	SetParameters([]string) error
}

func NewRandom

func NewRandom(min int64, max int64) FieldGenerator

type PartitionKey

type PartitionKey struct {
	Prefix string
	Id     uint64
}

func (*PartitionKey) GetText

func (p *PartitionKey) GetText() string

type PartitionKeyGenerator

type PartitionKeyGenerator struct {
	GenFunc func(uint64) uint64
	Prefix  string
}

func Random

func Random(prefix string) *PartitionKeyGenerator

func Sequence

func Sequence(prefix string) *PartitionKeyGenerator

func (*PartitionKeyGenerator) GenerateKey

func (g *PartitionKeyGenerator) GenerateKey(total uint64, maxId uint64) <-chan *PartitionKey

type Registry

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

func NewRegistry

func NewRegistry() *Registry

func (*Registry) GetGenerator

func (r *Registry) GetGenerator(table string, field string) FieldGenerator

func (*Registry) SetDefault

func (r *Registry) SetDefault(field Field, generator FieldGenerator)

Jump to

Keyboard shortcuts

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