config

package
v1.21.1 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PositionSource      = "source"
	PositionDisassembly = "disassembly"
	PositionDefault     = "default"
)

Variables

This section is empty.

Functions

func ConfigureFindFieldByName added in v1.21.1

func ConfigureFindFieldByName(conf interface{}, name, tag string) reflect.Value

func ConfigureList added in v1.21.1

func ConfigureList(w io.Writer, config interface{}, tag string)

func ConfigureListByName added in v1.21.1

func ConfigureListByName(conf interface{}, name, tag string) string

func ConfigureSetSimple added in v1.21.1

func ConfigureSetSimple(rest string, cfgname string, field reflect.Value) error

func GetConfigFilePath

func GetConfigFilePath(file string) (string, error)

GetConfigFilePath gets the full path to the given config file name.

func IterateConfiguration added in v1.21.1

func IterateConfiguration(conf interface{}, tag string) *configureIterator

func SaveConfig added in v1.0.0

func SaveConfig(conf *Config) error

SaveConfig will marshal and save the config struct to disk.

func Split2PartsBySpace added in v1.21.1

func Split2PartsBySpace(s string) []string

func SplitQuotedFields added in v1.0.0

func SplitQuotedFields(in string, quote rune) []string

SplitQuotedFields is like strings.Fields but ignores spaces inside areas surrounded by the specified quote character. To specify a single quote use backslash to escape it: \'

Types

type Config

type Config struct {
	// Commands aliases.
	Aliases map[string][]string `yaml:"aliases"`
	// Source code path substitution rules.
	SubstitutePath SubstitutePathRules `yaml:"substitute-path"`

	// MaxStringLen is the maximum string length that the commands print,
	// locals, args and vars should read (in verbose mode).
	MaxStringLen *int `yaml:"max-string-len,omitempty"`
	// MaxArrayValues is the maximum number of array items that the commands
	// print, locals, args and vars should read (in verbose mode).
	MaxArrayValues *int `yaml:"max-array-values,omitempty"`
	// MaxVariableRecurse is output evaluation depth of nested struct members, array and
	// slice items and dereference pointers
	MaxVariableRecurse *int `yaml:"max-variable-recurse,omitempty"`
	// DisassembleFlavor allow user to specify output syntax flavor of assembly, one of
	// this list "intel"(default), "gnu", "go"
	DisassembleFlavor *string `yaml:"disassemble-flavor,omitempty"`

	// If ShowLocationExpr is true whatis will print the DWARF location
	// expression for its argument.
	ShowLocationExpr bool `yaml:"show-location-expr"`

	// Source list line-number color, as a terminal escape sequence.
	// For historic reasons, this can also be an integer color code.
	SourceListLineColor interface{} `yaml:"source-list-line-color"`

	// Source list arrow color, as a terminal escape sequence.
	SourceListArrowColor string `yaml:"source-list-arrow-color"`

	// Source list keyword color, as a terminal escape sequence.
	SourceListKeywordColor string `yaml:"source-list-keyword-color"`

	// Source list string color, as a terminal escape sequence.
	SourceListStringColor string `yaml:"source-list-string-color"`

	// Source list number color, as a terminal escape sequence.
	SourceListNumberColor string `yaml:"source-list-number-color"`

	// Source list comment color, as a terminal escape sequence.
	SourceListCommentColor string `yaml:"source-list-comment-color"`

	// Source list tab color, as a terminal escape sequence.
	SourceListTabColor string `yaml:"source-list-tab-color"`

	// number of lines to list above and below cursor when printfile() is
	// called (i.e. when execution stops, listCommand is used, etc)
	SourceListLineCount *int `yaml:"source-list-line-count,omitempty"`

	// DebugInfoDirectories is the list of directories Delve will use
	// in order to resolve external debug info files.
	DebugInfoDirectories []string `yaml:"debug-info-directories"`

	// Position controls how the current position in the program is displayed.
	// There are three possible values:
	//  - source: always show the current position in the program's source
	//    code.
	//  - disassembly: always should the current position by disassembling the
	//    current function.
	//  - default (or the empty string): use disassembly for step-instruction,
	//    source for everything else.
	Position string `yaml:"position"`

	// Tab changes what is printed when a '\t' is encountered in source code.
	// This can be used to shorten the tabstop (e.g. "  ") or to print a more
	// visual indent (e.g. ">__ ").
	Tab string `yaml:"tab"`

	// TraceShowTimestamp controls whether to show timestamp in the trace
	// output.
	TraceShowTimestamp bool `yaml:"trace-show-timestamp"`
}

Config defines all configuration options available to be set through the config file.

func LoadConfig

func LoadConfig() (*Config, error)

LoadConfig attempts to populate a Config object from the config.yml file.

func (*Config) GetDisassembleFlavour added in v1.21.1

func (c *Config) GetDisassembleFlavour() api.AssemblyFlavour

func (*Config) GetSourceListLineCount added in v1.21.1

func (c *Config) GetSourceListLineCount() int

type SubstitutePathRule

type SubstitutePathRule struct {
	// Directory path will be substituted if it matches `From`.
	From string
	// Path to which substitution is performed.
	To string
}

SubstitutePathRule describes a rule for substitution of path to source code file.

type SubstitutePathRules

type SubstitutePathRules []SubstitutePathRule

SubstitutePathRules is a slice of source code path substitution rules.

Jump to

Keyboard shortcuts

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