generator

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2025 License: MIT Imports: 4 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddTask added in v0.1.0

func AddTask(task Task) error

Types

type BaseTask added in v0.1.0

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

func NewBaseTask added in v0.1.0

func NewBaseTask(taskName string, parameterCount int) *BaseTask

func (*BaseTask) GetTags added in v0.1.0

func (b *BaseTask) GetTags(params ...string) reflect.StructTag

func (*BaseTask) Name added in v0.1.0

func (b *BaseTask) Name() string

func (*BaseTask) ParameterCount added in v0.1.0

func (b *BaseTask) ParameterCount() int

func (*BaseTask) ValidateParamCount added in v0.1.0

func (b *BaseTask) ValidateParamCount(params ...string)

type GenerationFunction

type GenerationFunction interface {
	Generate() any
	Kind() reflect.Kind
}

type Task

type Task interface {
	GetTags(params ...string) reflect.StructTag
	ParameterCount() int
	Name() string
	Instance(params ...string) TaskInstance
}

func GetTask added in v0.1.0

func GetTask(task string) Task

type TaskInstance added in v0.1.0

type TaskInstance interface {
	GenerationFunction() GenerationFunction
	SetParameters(params ...string)
}

type TaskProperties added in v0.1.0

type TaskProperties struct {
	TaskName string
	// contains filtered or unexported fields
}

func CreateTaskPropertiesFromParams added in v0.1.0

func CreateTaskPropertiesFromParams(taskName string, params ...any) *TaskProperties

func CreateTaskPropertiesFromTag added in v0.1.0

func CreateTaskPropertiesFromTag(tag reflect.StructTag) (*TaskProperties, error)

CreateTaskPropertiesFromTag creates a TaskProperties struct from a reflect.StructTag structure of gen task tag is as follows: gen_task:"task_name(parameter_count)" gen_task_1:"parameter_1" gen_task_2:"parameter_2"

func (*TaskProperties) Parameters added in v0.1.0

func (tp *TaskProperties) Parameters() []string

func (*TaskProperties) SetParameters added in v0.1.0

func (tp *TaskProperties) SetParameters(params ...any)

Directories

Path Synopsis
Package config provides the configuration for the generation of dynamic structs.
Package config provides the configuration for the generation of dynamic structs.

Jump to

Keyboard shortcuts

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