plugin

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetConfig

func SetConfig(config Config) error

Types

type Action

type Action = func() error

func CommandAction

func CommandAction(name string, arg ...string) Action

func ConfirmAndThenActions

func ConfirmAndThenActions(prompt string, actions ...Action) Action

type Config

type Config struct {
	ModuleUrlBase string `json:"module_url_base"`
}

func GetConfig

func GetConfig() (Config, error)

type Engine

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

func NewEngine

func NewEngine(plugins ...Plugin) *Engine

func (*Engine) Run

func (e *Engine) Run(dir string) error

type EntryPoint

type EntryPoint struct {
	IsDir bool
	Path  string
	Line  int
}

type FeatureType

type FeatureType int

type Plugin

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

func (Plugin) PostGenerationFeatures

func (p Plugin) PostGenerationFeatures() []PostGenerationFeature

func (Plugin) TemplateFeatures

func (p Plugin) TemplateFeatures() []TemplateFeature

type PluginBuilder

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

func Builder

func Builder() *PluginBuilder

func (*PluginBuilder) Build

func (p *PluginBuilder) Build() Plugin

func (*PluginBuilder) PostGenerationFeature

func (p *PluginBuilder) PostGenerationFeature() *PostGenerationFeatureBuilder

func (*PluginBuilder) TemplateFeature

func (p *PluginBuilder) TemplateFeature() *TemplateFeatureBuilder

type PostGenerationContext

type PostGenerationContext struct {
	EntryPoint EntryPoint
}

type PostGenerationFeature

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

type PostGenerationFeatureBuilder

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

func (*PostGenerationFeatureBuilder) AddFeature

func (*PostGenerationFeatureBuilder) WithAvailabilityFilter

func (f *PostGenerationFeatureBuilder) WithAvailabilityFilter(filter func() bool) *PostGenerationFeatureBuilder

func (*PostGenerationFeatureBuilder) WithDescription

func (f *PostGenerationFeatureBuilder) WithDescription(description string) *PostGenerationFeatureBuilder

func (*PostGenerationFeatureBuilder) WithName

func (*PostGenerationFeatureBuilder) WithPostGenerationAction

func (f *PostGenerationFeatureBuilder) WithPostGenerationAction(action func(PostGenerationContext) error) *PostGenerationFeatureBuilder

type Predicate

type Predicate func() bool

func False

func False() Predicate

func HasExec

func HasExec(name string) Predicate

func True

func True() Predicate

func (Predicate) And

func (p Predicate) And(predicate Predicate) Predicate

func (Predicate) Or

func (p Predicate) Or(predicate Predicate) Predicate

type TemplateContext

type TemplateContext struct {
	ProjectDir string
	GoVersion  string
	Config     Config
}

type TemplateFeature

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

func (TemplateFeature) String

func (t TemplateFeature) String() string

type TemplateFeatureBuilder

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

func (*TemplateFeatureBuilder) AddFeature

func (f *TemplateFeatureBuilder) AddFeature() *PluginBuilder

func (*TemplateFeatureBuilder) WithAvailabilityFilter

func (f *TemplateFeatureBuilder) WithAvailabilityFilter(filter Predicate) *TemplateFeatureBuilder

func (*TemplateFeatureBuilder) WithDescription

func (f *TemplateFeatureBuilder) WithDescription(description string) *TemplateFeatureBuilder

func (*TemplateFeatureBuilder) WithEntryPoint

func (f *TemplateFeatureBuilder) WithEntryPoint(entrypoint func(TemplateContext) EntryPoint) *TemplateFeatureBuilder

func (*TemplateFeatureBuilder) WithGetTemplateData

func (f *TemplateFeatureBuilder) WithGetTemplateData(getter func(TemplateContext) (any, error)) *TemplateFeatureBuilder

func (*TemplateFeatureBuilder) WithName

func (*TemplateFeatureBuilder) WithNewTemplate

Jump to

Keyboard shortcuts

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