internal

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	RootDir      string
	TemplatesDir string
	// contains filtered or unexported fields
}

func NewApp

func NewApp(log *logrus.Logger, rootDir, templatesDir string) *App

func (*App) Generate

func (a *App) Generate(ctx context.Context, options ReplaceOptions) (string, error)

func (*App) GetDirectories

func (a *App) GetDirectories(_ context.Context, selectedDir string) ([]string, error)

func (*App) GetTemplatesList

func (a *App) GetTemplatesList(_ context.Context) ([]Template, error)

func (*App) PreviewList

func (a *App) PreviewList(_ context.Context, options ReplaceOptions) ([]PreviewListItem, error)

func (*App) RawList

func (a *App) RawList(ctx context.Context, options ReplaceOptions) ([]PreviewListItem, error)

type Placeholder

type Placeholder struct {
	Value       string `json:"value"`
	Replace     string `json:"replace"`
	Description string `json:"description"`
}

type Placeholders

type Placeholders []Placeholder

type PreviewListItem

type PreviewListItem struct {
	IsDir   bool   `json:"is_dir"`
	IsNew   bool   `json:"is_new"`
	Path    string `json:"path"`
	Content string `json:"content"`
}

type ReplaceOptions

type ReplaceOptions struct {
	TemplateID            string        `json:"template_id"`
	TargetRelativeRootDir string        `json:"target_dir"`
	Placeholders          []Placeholder `json:"placeholders"`
}

type Template

type Template struct {
	ID           string        `json:"id"`
	Name         string        `json:"name"`
	TargetDir    string        `json:"target_dir"`
	Description  string        `json:"description"`
	Placeholders []Placeholder `json:"placeholders"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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