config

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// The name of the current namespace.
	//
	// Namespaces are used to reference executables in the CLI using the format
	// `workspace:namespace/name`.
	// If the namespace is not set, only executables defined without a namespace will
	// be discovered.
	//
	CurrentNamespace string `json:"currentNamespace,omitempty" yaml:"currentNamespace,omitempty" mapstructure:"currentNamespace,omitempty"`

	// The name of the current workspace. This should match a key in the `workspaces`
	// or `remoteWorkspaces` map.
	CurrentWorkspace string `json:"currentWorkspace" yaml:"currentWorkspace" mapstructure:"currentWorkspace"`

	// The default log mode to use when running executables.
	// This can either be `hidden`, `json`, `logfmt` or `text`
	//
	// `hidden` will not display any logs.
	// `json` will display logs in JSON format.
	// `logfmt` will display logs with a log level, timestamp, and message.
	// `text` will just display the log message.
	//
	DefaultLogMode io.LogMode `json:"defaultLogMode,omitempty" yaml:"defaultLogMode,omitempty" mapstructure:"defaultLogMode,omitempty"`

	// The default timeout to use when running executables.
	// This should be a valid duration string.
	//
	DefaultTimeout time.Duration `json:"defaultTimeout,omitempty" yaml:"defaultTimeout,omitempty" mapstructure:"defaultTimeout,omitempty"`

	// Interactive corresponds to the JSON schema field "interactive".
	Interactive *Interactive `json:"interactive,omitempty" yaml:"interactive,omitempty" mapstructure:"interactive,omitempty"`

	// A map of flowfile template names to their paths.
	Templates ConfigTemplates `json:"templates,omitempty" yaml:"templates,omitempty" mapstructure:"templates,omitempty"`

	// The theme of the interactive UI.
	Theme ConfigTheme `json:"theme,omitempty" yaml:"theme,omitempty" mapstructure:"theme,omitempty"`

	// The mode of the workspace. This can be either `fixed` or `dynamic`.
	// In `fixed` mode, the current workspace used at runtime is always the one set in
	// the currentWorkspace config field.
	// In `dynamic` mode, the current workspace used at runtime is determined by the
	// current directory.
	// If the current directory is within a workspace, that workspace is used.
	//
	WorkspaceMode ConfigWorkspaceMode `json:"workspaceMode,omitempty" yaml:"workspaceMode,omitempty" mapstructure:"workspaceMode,omitempty"`

	// Map of workspace names to their paths. The path should be a valid absolute path
	// to the workspace directory.
	//
	Workspaces ConfigWorkspaces `json:"workspaces" yaml:"workspaces" mapstructure:"workspaces"`
}

User Configuration for the Flow CLI. Includes configurations for workspaces, templates, I/O, and other settings for the CLI.

It is read from the user's flow config directory: - **MacOS**: `$HOME/Library/Application Support/flow` - **Linux**: `$HOME/.config/flow` - **Windows**: `%APPDATA%\flow`

Alternatively, a custom path can be set using the `FLOW_CONFIG_PATH` environment variable.

func (*Config) JSON

func (c *Config) JSON() (string, error)

func (*Config) Markdown

func (c *Config) Markdown() string

func (*Config) SendSoundNotification

func (c *Config) SendSoundNotification() bool

func (*Config) SendTextNotification

func (c *Config) SendTextNotification() bool

func (*Config) SetDefaults

func (c *Config) SetDefaults()

func (*Config) ShowTUI

func (c *Config) ShowTUI() bool

func (*Config) Validate

func (c *Config) Validate() error

func (*Config) YAML

func (c *Config) YAML() (string, error)

type ConfigTemplates

type ConfigTemplates map[string]string

A map of flowfile template names to their paths.

type ConfigTheme added in v0.6.1

type ConfigTheme string
const ConfigThemeDark ConfigTheme = "dark"
const ConfigThemeDefault ConfigTheme = "default"
const ConfigThemeDracula ConfigTheme = "dracula"
const ConfigThemeLight ConfigTheme = "light"
const ConfigThemeTokyoNight ConfigTheme = "tokyo-night"

func (ConfigTheme) String added in v0.6.1

func (ct ConfigTheme) String() string

type ConfigWorkspaceMode

type ConfigWorkspaceMode string
const ConfigWorkspaceModeDynamic ConfigWorkspaceMode = "dynamic"
const ConfigWorkspaceModeFixed ConfigWorkspaceMode = "fixed"

type ConfigWorkspaces

type ConfigWorkspaces map[string]string

Map of workspace names to their paths. The path should be a valid absolute path to the workspace directory.

type Interactive

type Interactive struct {
	// Enabled corresponds to the JSON schema field "enabled".
	Enabled bool `json:"enabled" yaml:"enabled" mapstructure:"enabled"`

	// Whether to send a desktop notification when a command completes.
	NotifyOnCompletion *bool `json:"notifyOnCompletion,omitempty" yaml:"notifyOnCompletion,omitempty" mapstructure:"notifyOnCompletion,omitempty"`

	// Whether to play a sound when a command completes.
	SoundOnCompletion *bool `json:"soundOnCompletion,omitempty" yaml:"soundOnCompletion,omitempty" mapstructure:"soundOnCompletion,omitempty"`
}

Configurations for the interactive UI.

Jump to

Keyboard shortcuts

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