types

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config interface {
	Validate() error
}

Config is interface which help to pass value and validate it

type Date

type Date struct {
	// From is date time which should start from this date
	From string
	// To is last range of the possible date
	To string
	// Format is means result of the date generation.
	// Also, From and To fields are validated by Format
	Format string
}

Date is strategy to generate date related column

func (Date) GetFormat

func (d Date) GetFormat() string

GetFormat is returns defaultFormat or Format field

func (Date) Validate

func (d Date) Validate() error

Validate is check struct

type DateBuilder

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

DateBuilder is generate dates

func NewDateBuilder

func NewDateBuilder() *DateBuilder

NewDateBuilder is constructor of the DateBuilder

func (*DateBuilder) Build

func (d *DateBuilder) Build(args ...string) string

Build return generated value

func (*DateBuilder) Initiate

func (d *DateBuilder) Initiate(config Config) error

Initiate is need to init struct

func (*DateBuilder) Validate

func (d *DateBuilder) Validate() error

Validate check internal state of the builder

type Human

type Human struct {
	// Mode is defined what will return it
	Mode HumanMode `json:"mode" yaml:"mode"`
}

Human is to struct to generate personal data

func (Human) Validate

func (h Human) Validate() error

Validate check struct

type HumanMode

type HumanMode string
const (
	FirstNameMode HumanMode = "first_name"
	LastNameMode  HumanMode = "last_name"
	FullNameMode  HumanMode = "fullname"
)

type HumanNameBuilder

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

HumanNameBuilder is build personal data

func NewHumanNameBuilder

func NewHumanNameBuilder() *HumanNameBuilder

NewHumanNameBuilder is constructor of HumanNameBuilder

func (*HumanNameBuilder) Build

func (h *HumanNameBuilder) Build(s ...string) string

Build return generated value

func (*HumanNameBuilder) Initiate

func (h *HumanNameBuilder) Initiate(config Config) error

Initiate is need to init struct

func (*HumanNameBuilder) Validate

func (h *HumanNameBuilder) Validate() error

Validate check struct

type Number

type Number struct {
	// From is first possible integer
	From float64 `yaml:"from" json:"from"`
	// To is last possible integer
	To float64 `yaml:"to" json:"to"`
}

Number is strategy to generate number related column

func (Number) Validate

func (n Number) Validate() error

Validate check struct

type NumberBuilder

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

NumberBuilder is build number data

func NewNumberBuilder

func NewNumberBuilder(numbersMode NumberMode) *NumberBuilder

NewNumberBuilder is constructor of NumberBuilder

func (NumberBuilder) Build

func (n NumberBuilder) Build(args ...string) string

Build return generated value

func (*NumberBuilder) Initiate

func (n *NumberBuilder) Initiate(config Config) error

Initiate is need to init struct

func (NumberBuilder) Validate

func (n NumberBuilder) Validate() error

Validate check struct

type NumberMode

type NumberMode string

NumberMode is possible modes

const (
	// IntegerNumberMode is integer
	IntegerNumberMode NumberMode = "int"
	// FloatNumberMode is float
	FloatNumberMode NumberMode = "float"
)

type Sequence

type Sequence struct {
	Initial int
}

func (Sequence) GetInitialSequence

func (s Sequence) GetInitialSequence() int

func (Sequence) Validate

func (s Sequence) Validate() error

Validate check struct

type SequenceBuilder

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

func NewSequenceBuilder

func NewSequenceBuilder() *SequenceBuilder

func (*SequenceBuilder) Build

func (b *SequenceBuilder) Build(args ...string) string

func (*SequenceBuilder) Initiate

func (b *SequenceBuilder) Initiate(config Config) error

func (*SequenceBuilder) Validate

func (b *SequenceBuilder) Validate() error

Validate check struct

type TYPE

type TYPE int
const (
	INT TYPE = iota
	FLOAT
	STRING
	PERSONAL
	DATE
	SEQ
)

func (TYPE) String

func (t TYPE) String() string

Jump to

Keyboard shortcuts

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