Documentation
¶
Index ¶
- type ColorPalette
- type Config
- func (c *Config) CurrentVaultName() string
- func (c *Config) JSON() (string, error)
- func (c *Config) Markdown() string
- func (c *Config) SendSoundNotification() bool
- func (c *Config) SendTextNotification() bool
- func (c *Config) SetDefaults()
- func (c *Config) ShowTUI() bool
- func (c *Config) Validate() error
- func (c *Config) YAML() (string, error)
- type ConfigTemplates
- type ConfigTheme
- type ConfigVaults
- type ConfigWorkspaceMode
- type ConfigWorkspaces
- type Interactive
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 (*Config) SendSoundNotification ¶
func (*Config) SendTextNotification ¶
func (*Config) SetDefaults ¶
func (c *Config) SetDefaults()
type ConfigTemplates ¶
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 ¶
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 ¶
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.