pkg

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2023 License: MIT Imports: 13 Imported by: 42

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitLogger

func InitLogger() error

func InitLoggerWithConfig

func InitLoggerWithConfig(config *LogConfig) error

func InitViper

func InitViper(appName string, rootCmd *cobra.Command) error

Types

type CommandLoader added in v0.0.9

type CommandLoader[T glazed_cmds.Command] struct {
	// contains filtered or unexported fields
}

func NewCommandLoader added in v0.0.9

func NewCommandLoader[T glazed_cmds.Command](locations *CommandLocations) *CommandLoader[T]

func (*CommandLoader[T]) LoadCommands added in v0.0.9

func (c *CommandLoader[T]) LoadCommands(
	loader glazed_cmds.FSCommandLoader,
	helpSystem *help.HelpSystem,
	rootCmd *cobra.Command,
	options ...glazed_cmds.CommandDescriptionOption,
) ([]T, []*glazed_cmds.CommandAlias, error)

type CommandLocations

type CommandLocations struct {
	Embedded         []EmbeddedCommandLocation
	Repositories     []string
	AdditionalLayers []layers.ParameterLayer
	HelpSystem       *help.HelpSystem
}

func NewCommandLocations added in v0.0.6

func NewCommandLocations(options ...LoadCommandsOption) *CommandLocations

type EmbeddedCommandLocation

type EmbeddedCommandLocation struct {
	FS      fs.FS
	Name    string
	Root    string
	DocRoot string
}

type LoadCommandsOption added in v0.0.6

type LoadCommandsOption func(*CommandLocations)

func WithAdditionalLayers added in v0.0.6

func WithAdditionalLayers(layers ...layers.ParameterLayer) LoadCommandsOption

func WithEmbeddedLocations added in v0.0.6

func WithEmbeddedLocations(locations ...EmbeddedCommandLocation) LoadCommandsOption

func WithHelpSystem added in v0.0.6

func WithHelpSystem(helpSystem *help.HelpSystem) LoadCommandsOption

func WithRepositories added in v0.0.6

func WithRepositories(locations ...string) LoadCommandsOption

type LogConfig

type LogConfig struct {
	WithCaller bool
	Level      string
	LogFormat  string
	LogFile    string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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