hygen

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: MIT Imports: 14 Imported by: 0

README

POSH doctl provider

Usage

Plugin
package main

type Plugin struct {
  l        log.Logger
  cache    cache.Cache
  commands command.Commands
}

func New(l log.Logger) (plugin.Plugin, error) {
  var err error
  inst := &Plugin{
    l:        l,
    cache:    &cache.MemoryCache{},
    commands: command.Commands{},
  }

  // ...

  inst.commands.MustAdd(hygen.NewCommand(l, inst.cache))

  // ...

  return inst, nil
}
Config
## hygen
hygen:
  templatePath: .posh/scaffold
Ownbrew

To install binary locally, add:

ownbrew:
  packages:
    ## https://github.com/jondot/hygen/releases
    - name: hygen
      tap: foomo/tap/jondot/hygen
      version: 6.2.11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

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

func NewCommand

func NewCommand(l log.Logger, cache cache.Cache, opts ...Option) (*Command, error)

func (*Command) Complete

func (c *Command) Complete(ctx context.Context, r *readline.Readline) []goprompt.Suggest

func (*Command) Description

func (c *Command) Description() string

func (*Command) Execute

func (c *Command) Execute(ctx context.Context, r *readline.Readline) error

func (*Command) Help

func (c *Command) Help(ctx context.Context, r *readline.Readline) string

func (*Command) Name

func (c *Command) Name() string

func (*Command) Validate

func (c *Command) Validate(ctx context.Context, r *readline.Readline) error

type Config added in v0.4.4

type Config struct {
	TemplatePath string `yaml:"templatePath"`
}

type Option added in v0.4.4

type Option func(*Command) error

func CommandWithName

func CommandWithName(v string) Option

func WithConfigKey added in v0.4.4

func WithConfigKey(v string) Option

Jump to

Keyboard shortcuts

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