Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrKVStrInvalidToken = errors.New("kv-str invalid token") ErrKVStrReflectError = errors.New("kv-str reflect error") )
Functions ¶
Types ¶
type KVStr ¶
type KVStr string
KVStr is a string containing a set of key value pairs
By convention, KV strings are optionally concatenated with space-separated key=value pairs. Each key=value pair is separated by a comma (U+002C ',') or semicolon (U+003B ';')
Each key is a non-empty string that satisfies the syntax of go identity. Value can have four types:
numeric: Any integer, floating point, or complex number
that satisfies the go syntax e.g. `a=1,b=2.,c=.3,d=01 ,e=10e2` => {a:1, b:2, c:.3, d:01, e:10e2}
character: Any character enclosed by single-quotes `'`
e.g. `char='x'` => {char:x}
boolean: Only the value of `false` means that the value
is false, in other cases you can just write key, the `=value` part can be omitted e.g. `switch,window` => {switch:true, window:true}
string: Any character enclosed by back-quotes ```, or
any character concatenation to the next separator that is not one of the above cases, where consecutive whitespace characters are treated as a single whitespace character e.g. `str=this is a string,str2=`quoted string`` => {str:"this is a string", str2="`quoted string`"}
Click to show internal directories.
Click to hide internal directories.