generator

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package generator provides migration generator.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action interface {
	Generate(context.Context) error
}

Action describes generator action.

type Generator

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

Generator describes migrations generator.

func Generate

func Generate(info string, opts ...Option) *Generator

Generate returns new Generator.

func (*Generator) To

func (g *Generator) To(directory string) error

To generate a migration in specified directory.

type Option

type Option func(*Generator)

Option describes Generator option.

func WithActions

func WithActions(a ...Action) Option

WithActions to set custom actions.

func WithFs

func WithFs(fs afero.Fs) Option

WithFs to set custom Fs.

func WithValidator

func WithValidator(v Validator) Option

WithValidator to set custom Validator.

type Validator

type Validator interface {
	Validate(afero.Fs, string, string) error
}

Validator describes validator interface.

Directories

Path Synopsis
actions
executor
Package executor provides action to generate executor constructor.
Package executor provides action to generate executor constructor.
migration
Package migration provides action to generate migration.
Package migration provides action to generate migration.
Package context provides generator context.
Package context provides generator context.
Package validator provides generator validator.
Package validator provides generator validator.
errors
Package errors provides validation errors.
Package errors provides validation errors.
rules
Package rules provides validator rules.
Package rules provides validator rules.

Jump to

Keyboard shortcuts

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