config

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ParameterModeSet     = "SET"
	ParameterModeReplace = "REPLACE"
)
View Source
const (
	Version = migrations.Latest
)

Variables

View Source
var ErrInvalidConfig = errors.New("invalid config file")

Functions

func SerializeToYamlWithComment added in v1.0.0

func SerializeToYamlWithComment(value interface{}) []byte

Types

type Config

type Config struct {
	Style              ui.Config       `yaml:"style" mapstructure:"style"`
	Editor             string          `` /* 215-byte string literal not displayed */
	DefaultRootCommand string          `` /* 196-byte string literal not displayed */
	FuzzySearch        bool            `yaml:"fuzzySearch" mapstructure:"fuzzySearch" head_comment:"Enable fuzzy searching for snippet titles."`
	Script             ScriptConfig    `yaml:"scripts" mapstructure:"scripts" head_comment:"Options regarding script handling"`
	Manager            managers.Config `yaml:"manager" mapstructure:"manager"`
}

type ErrConfigNotFound

type ErrConfigNotFound struct {
	// contains filtered or unexported fields
}

func (ErrConfigNotFound) Error

func (e ErrConfigNotFound) Error() string

func (ErrConfigNotFound) Is

func (e ErrConfigNotFound) Is(target error) bool

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option configures an App.

func WithSystem

func WithSystem(system *system.System) Option

WithSystem sets the system instance for the Service.

func WithTerminal

func WithTerminal(t ui.TUI) Option

WithTerminal sets the tui for the Service.

func WithViper

func WithViper(v *viper.Viper) Option

WithViper sets the viper instance for the Service.

type ParameterMode added in v1.2.0

type ParameterMode string

type ScriptConfig added in v1.2.0

type ScriptConfig struct {
	Shell          string        `` /* 170-byte string literal not displayed */
	ParameterMode  ParameterMode `` /* 242-byte string literal not displayed */
	RemoveComments bool          `` /* 155-byte string literal not displayed */
	ExecConfirm    bool          `` /* 212-byte string literal not displayed */
	ExecPrint      bool          `` /* 172-byte string literal not displayed */
}

type Service

type Service interface {
	Create()
	LoadConfig() (Config, error)
	Edit()
	Clean()
	UpdateManagerConfig(config managers.Config)
	NeedsMigration() (bool, string)
	Migrate()
	ConfigFilePath() string
	Info() []model.InfoLine
}

func NewService

func NewService(options ...Option) Service

NewService creates a new Service.

type VersionWrapper

type VersionWrapper struct {
	Version string `yaml:"version" mapstructure:"version"`
	Config  Config `yaml:"config" mapstructure:"config"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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