| Age | Commit message (Collapse) | Author |
|
=== Breaking changes
* All ASCII related contants and functions now being moved from `bytes`
package to `ascii` package.
=== New Features
* ascii: new library for working with ASCII characters
=== Enhancements
* dns: add method to restart forwarders
* dns: add fallback nameservers
* ini: create new section or variable if not exist on Set
|
|
Previously, we use a boolean condition to stop all forwarders by setting
it to false. But, this method does not work because using select
statement with single case, will block the process.
This change, allocated a new boolean channel for each forwarders, that
is stored on server fields and when we need to stop or restart all
forwarders, we send the boolean value "true" to each channel.
|
|
For readibility, each section should start with an empty line.
|
|
|
|
When query with DoH forwarder return an error, we assume that there is
a problem with the connection. To mitigate the problem when subsequent
query using broken connection return an error, we close the forwarder
connection and create a new one.
|
|
The fallback nameservers is another list of parent name servers that
will be queried if the primary NameServers return an error.
|
|
Previous behaviour of Set() method will return false if the section
or subsection of key to be set not found on database.
This commit change the behaviour of Set(). If no section or subsection
found on database, the new section with key-value will be created.
If no key found, the new key-value will be added to the specific section.
|
|
The RestartForwarders method allow server to change the parent nameserver
address to new one. An example of use case is when system change the
network through WiFi, which cause the nameserver address also change
in the resolv.conf file.
|
|
This library previously part of bytes package. To make it bytes package
consistent (only working with slice of byte), we move all ASCII related
constants, variables, and functions into new package.
|
|
This release bring major refactoring on `ini` package to provide a clean
and simple API.
=== Breaking Changes
* ini: major refactoring
* net: add parameter to check Fully Qualified Domain Name on
IsHostnameValid
=== New Features
* spf: implementation of Sender Policy Framework (RFC 7208)
* ssh: package ssh provide a wrapper to golang.org/x/crypto/ssh
=== Enhancements
* dns: add function to lookup PTR record by IP address
* dns: export Lookup method as part of Client interface
* doc: regenerate to use new style
* http: print the not-found path on Server's getFSNode()
* ini: add method Vars that return all variables as map
* ini: add method to Rebase other INI object
* ini: add method to add, set, and unset variable
* ini: add method to convert key-value to map
* ini: add method to get section object by section and/or subsection name
* ini: add method to get variable values as slice of string
* ini: add method to prune INI variables
* ini: add methods to support templating
* io: add function to check if content of file is binary
* net: add function to check if IP address is IPv4 or IPv6
* net: add function to convert IPv6 into dot format
* ns: set log flag to 0, without time prefix
* strings: add function to append uniq values to slice of strings
=== Bug Fixes
* io: watch changes on sub of sub directories on DirWatcher
* dns: substract the message TTL when the answer found on cache
* dns: always return true when answers RR exist and no TTL is zero
|
|
Command smtpcli provide a command line interface to SMTP client protocol.
|
|
|
|
|
|
|
|
|
|
The valid syntax to suppress linter warnings is "//nolint:<name>" with
no space between comment and "nolint" and between ":". Also, we move the
placement of nolint directive to the top of statements for multiple
nolint in the same scope.
While at it, fix and supress some linter warnings.
|
|
|
|
|
|
The field Environments contains system environment variables that will
be passed to Execute.
|
|
Given a section name and/or subsection name, Vars() method will return
all variables as map of key and value.
If there is a duplicate in key's name, only the last key value that will
be store on map value.
This method is a shortcut that can be used in templating.
|
|
If section name is not empty, only the keys will be listed in the map.
|
|
Basically, the function count the ratio between printable characters for
the first 512 bytes or more, excluding spaces. If the ratio is greater
than 75% then its a text; otherwise its a binary.
|
|
The following methods are added to support templating using this package,
* Subs(): a method that return all non-empty subsections
* Val(): a method that return the last variable's value using key's path
as combination of section-name ":" sub-section-name ":" key.
* Vals(): a method that return all variable values as slice of string
This changes cause the section type to be exported back, again.
|
|
If the variable is quoted, the value must be escaped so the following
character are allowed: '\b', '\n', '\t', '\\', and '\"'.
|
|
The Add() method will add new key and value to the last item in section
and/or subsection.
The Set() method set the last variable's value in section-subsection that
match with the key.
The Unset() method will remove the last variable's in section and/or
subsection that match with the key.
|
|
This is the fifth part of refactoring ini package.
Some of the changes,
* add() now will append the new variable if the same already exist but
the value is different.
* remove unused getFirstIndex() method
* add method getVariable() that return the last variable in the section
by key
* set() method will not add or append new variable if key is not exist,
instead it will return false.
* unset() method will remove the last variable on section, even if key
is duplicate.
|
|
This is the third part of refactoring ini package. The change affect
on how variable value being fetched and formatted.
|
|
The lineModeSection and lineModeSubsection on variable's String switch
cases is previously used to print section and/or subsection before
the section is moved to its own type.
|
|
This is the second part of refactoring to provide clean and readable
code.
|
|
This is the first part to refactoring ini package to provide a clean
and simple API.
|
|
Basically, Rebase merge each sections in other INI object on top of
current INI object.
|
|
Pruning the INI variables means removing the empty lines, the comments,
and merge section and subsection that have the same name into one
group.
|
|
|
|
|
|
|
|
While at it, reformat and fix numbering on Variable rules.
|
|
Using iota we need to comment the constants value. By declaring the
value directly, it gives more clear statement.
|
|
|
|
|
|
This package provide a simple client initialization with additional
methods to copy file from local or remote using scp.
|
|
AsMap return the INI contents as mapping of
(section "." subsection "." var) as key
and the variable's value as slice of string.
For example, given the following INI file,
[section1]
key = value
[section2 "sub"]
key2 = value2
key2 = value3
it will be mapped as,
map["section1..key"] = []string{"value"}
map["section2.sub.key2"] = []string{"value2", "value3"}
|
|
The AppendUniq will append a string to slice only if the same string
its not already exist. The string is compared in case insensitive manner.
|
|
Previous IsExpired() will return true if answers exist but one of TTL in
authority or additional RR is zero. Since authority and additional RR
are complementary, any Message with EDNS that by default have zero TTL
will always return true.
This change check TLL expiration only on answers. As long as the answers
RR exist and no zero TTL it will return false.
We also remove zero TTL check on additional RR due to default zero value
for EDNS message.
|
|
|
|
This function only useful for expanding SPF macro "i" or when generating
query for DNS PTR.
|
|
|
|
Since the library (this packages) is for Go, the new style try to use
the same layout and format with Go doc style as in golang.org.
|
|
Currently, the standard library does not provide a function to check if IP
is IPv4 or IPv6. This is a naive implementation that check IP version
based on dot or colon.
|
|
|
|
The function LookupPTR accept any IP address (either IPv4 or IPv6) and
return a single domain name on success or an error on failed. If IP
address does not have PTR record it will return empty string without
error.
|