pkg

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2023 License: MIT Imports: 14 Imported by: 42

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CastList

func CastList[To any, From any](list []From) ([]To, bool)

func CastMapMember added in v0.0.4

func CastMapMember[To any](m map[string]interface{}, k string) (*To, bool)

func CastStringMap added in v0.0.4

func CastStringMap[To any, From any](m map[string]From) (map[string]To, bool)

func CastStringMap2 added in v0.0.5

func CastStringMap2[To any, From any](m interface{}) (map[string]To, bool)

func InitLogger

func InitLogger() error

func InitLoggerWithConfig

func InitLoggerWithConfig(config *LogConfig) error

func InitViper

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

Types

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

func (*CommandLocations) LoadCommands

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

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
}

Jump to

Keyboard shortcuts

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