Xgit v0.8.0 Xgit.ConfigEntry View Source

Represents one entry in a git configuration dictionary.

This is also commonly referred to as a "config line" because it typically occupies one line in a typical git configuration file.

The semantically-important portion of a configuration file (i.e. everything except comments and whitespace) could be represented by a list of ConfigEntry structs.

Link to this section Summary

Types

t()

Represents an entry in a git config file.

Functions

Returns true if passed a valid config entry.

Returns true if passed a valid config entry name.

Returns true if passed a valid config section name.

Returns true if passed a valid config subsection name.

Returns true if passed a valid config value string.

Link to this section Types

Link to this type

t()

View Source
t() :: %Xgit.ConfigEntry{
  name: String.t(),
  section: String.t(),
  subsection: String.t() | nil,
  value: String.t() | :remove_all | nil
}

Represents an entry in a git config file.

Struct Members

  • section: (String) section name for the entry
  • subsection: (String or nil) subsection name
  • name: (String) key name
  • value: (String, nil, or :remove_all) value

    • nil if the name is present without an =
    • :remove_all can be used as an instruction in some APIs to remove any corresponding entries

Link to this section Functions

Link to this function

valid?(entry)

View Source
valid?(value :: any()) :: boolean()

Returns true if passed a valid config entry.

Link to this function

valid_name?(name)

View Source
valid_name?(name :: any()) :: boolean()

Returns true if passed a valid config entry name.

Link to this function

valid_section?(section)

View Source
valid_section?(section :: any()) :: boolean()

Returns true if passed a valid config section name.

Only alphanumeric characters, -, and . are allowed in section names.

Link to this function

valid_subsection?(subsection)

View Source
valid_subsection?(subsection :: any()) :: boolean()

Returns true if passed a valid config subsection name.

Link to this function

valid_value?(value)

View Source
valid_value?(value :: any()) :: boolean()

Returns true if passed a valid config value string.

Important: At this level, we do not accept other data types.