config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2025 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 ColorPalette

type ColorPalette struct {
	// Black corresponds to the JSON schema field "black".
	Black *string `json:"black,omitempty" yaml:"black,omitempty" mapstructure:"black,omitempty"`

	// Body corresponds to the JSON schema field "body".
	Body *string `json:"body,omitempty" yaml:"body,omitempty" mapstructure:"body,omitempty"`

	// Border corresponds to the JSON schema field "border".
	Border *string `json:"border,omitempty" yaml:"border,omitempty" mapstructure:"border,omitempty"`

	// The style of the code block. For example, `monokai`, `dracula`, `github`, etc.
	// See [chroma styles](https://github.com/alecthomas/chroma/tree/master/styles)
	// for available style names.
	//
	//
	CodeStyle *string `json:"codeStyle,omitempty" yaml:"codeStyle,omitempty" mapstructure:"codeStyle,omitempty"`

	// Emphasis corresponds to the JSON schema field "emphasis".
	Emphasis *string `json:"emphasis,omitempty" yaml:"emphasis,omitempty" mapstructure:"emphasis,omitempty"`

	// Error corresponds to the JSON schema field "error".
	Error *string `json:"error,omitempty" yaml:"error,omitempty" mapstructure:"error,omitempty"`

	// Gray corresponds to the JSON schema field "gray".
	Gray *string `json:"gray,omitempty" yaml:"gray,omitempty" mapstructure:"gray,omitempty"`

	// Info corresponds to the JSON schema field "info".
	Info *string `json:"info,omitempty" yaml:"info,omitempty" mapstructure:"info,omitempty"`

	// Primary corresponds to the JSON schema field "primary".
	Primary *string `json:"primary,omitempty" yaml:"primary,omitempty" mapstructure:"primary,omitempty"`

	// Secondary corresponds to the JSON schema field "secondary".
	Secondary *string `json:"secondary,omitempty" yaml:"secondary,omitempty" mapstructure:"secondary,omitempty"`

	// Success corresponds to the JSON schema field "success".
	Success *string `json:"success,omitempty" yaml:"success,omitempty" mapstructure:"success,omitempty"`

	// Tertiary corresponds to the JSON schema field "tertiary".
	Tertiary *string `json:"tertiary,omitempty" yaml:"tertiary,omitempty" mapstructure:"tertiary,omitempty"`

	// Warning corresponds to the JSON schema field "warning".
	Warning *string `json:"warning,omitempty" yaml:"warning,omitempty" mapstructure:"warning,omitempty"`

	// White corresponds to the JSON schema field "white".
	White *string `json:"white,omitempty" yaml:"white,omitempty" mapstructure:"white,omitempty"`
}

The color palette for the interactive UI. The colors can be either an ANSI 16, ANSI 256, or TrueColor (hex) value. If unset, the default color for the current theme will be used.

type Config

type Config struct {
	// Override the default color palette for the interactive UI.
	// This can be used to customize the colors of the UI.
	//
	ColorOverride *ColorPalette `json:"colorOverride,omitempty" yaml:"colorOverride,omitempty" mapstructure:"colorOverride,omitempty"`

	// 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 vault. This should match a key in the `vaults` map.
	CurrentVault *string `json:"currentVault,omitempty" yaml:"currentVault,omitempty" mapstructure:"currentVault,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"`

	// A map of vault names to their paths. The path should be a valid absolute path
	// to the vault file created by flow.
	Vaults ConfigVaults `json:"vaults,omitempty" yaml:"vaults,omitempty" mapstructure:"vaults,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) CurrentVaultName

func (c *Config) CurrentVaultName() string

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

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

func (ConfigTheme) String

func (ct ConfigTheme) String() string

type ConfigVaults

type ConfigVaults map[string]string

A map of vault names to their paths. The path should be a valid absolute path to the vault file created by flow.

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