sample

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Provides sample commands used to demonstrate the command package.

Index

Constants

View Source
const (
	COUNT_MIN = 5
	COUNT_MAX = 100
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HelloCommand

type HelloCommand struct {
	command.CommandBase
}

Sample hello command for printing "Hello" to the console.

func NewHelloCommand

func NewHelloCommand() HelloCommand

Creates a new HelloCommand.

func (HelloCommand) Run

func (cmd HelloCommand) Run(args []string) error

Run the Hello commands. See usage string for details.

type SampleConfig added in v1.2.0

type SampleConfig struct {
	Path  string `json:"path"`
	Count int    `json:"count"`
}

A sample config object.

func (SampleConfig) Load added in v1.2.0

func (SampleConfig) Load() error

Implements Config interface Load method.

func (SampleConfig) Validate added in v1.2.0

func (cfg SampleConfig) Validate() ([]error, error)

Implements Config interface Validate method. Provides example implementation for writing validations.

Jump to

Keyboard shortcuts

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