Configuration Protocol
Squiid stores it's config file as TOML, which organizes data into sections with key: value pairs. In order to manipulate Squiid's config file, you must make a request to the server with the type of configuration
. The types of requests are documented below.
Reading the config file
This section provides example requests and responses for the following config file:
Get a specific key
- Arguments:
action_type
: (string) - a string ofget_key
section
: (string) - a string of the desired sectionkey
: (string) - the key of which to fetch the value
- Returns:
- (any) A payload containing the value of the key. Can be any valid TOML type (string, array, bool, etc.)
List Sections
- Arguments:
action_type
: (string
) - a string oflist_sections
.
- Returns:
- (
array[string]
) - A payload containing an array of strings of the section titles.
- (
List Keys
- Arguments:
action_type
: (string
) - a string oflist_keys
.section
: (string
) - a string of the section name.
- Returns:
- (
array[string]
) - A payload containing an array of keys.
- (
List Values
- Arguments:
action_type
: (string
) - a string oflist_values
.section
: (string
) - a string of the section name.
- Returns:
- (
array[string]
) - A payload containing an array of the values.
- (
List Items
- Arguments:
action_type
: (string
) - a string oflist_items
.section
: (string
) - a string of the section name.
- Returns:
- (
array[array[string, string]]
) - A payload containing an array of key-value pairs.
- (
Writing the config file
If there is an error, you will get a response_type
of error
instead of configuration
. More details here.
Set a specific key
- Arguments:
action_type
: (string
) - a string ofset_key
.section
: (string
) - a string of the section name.key
: (string
) - a string of the key name.value
: (any
) - the value to set. can be any valid TOML type.
- Returns:
- Nothing.
Create a Section
- Arguments:
action_type
: (string
) - a string ofcreate_section
.section
: (string
) - a string of the section name.
- Returns:
- Nothing.
Delete a Section
- Arguments:
action_type
: (string
) - a string ofdelete_section
.section
: (string
) - a string of the section name.
- Returns:
- Nothing.
Delete a Key
- Arguments:
action_type
: (string
) - a string ofdelete_key
.section
: (string
) - a string of the section name.key
: (string
) - a string of the key name.
- Returns:
- Nothing.