Skip to content
This repository has been archived by the owner on Nov 14, 2022. It is now read-only.

Tagging

Jamie Hardt edited this page Jan 14, 2018 · 3 revisions

Tagging allows us to use the clip name to convey multiple fields or key-value pairs of information. These can be parsed and then used by clients to give reports structure and detail.

The tagging process involves taking a single monolithic text string and producing a dictionary of string keys and string values:

func generateTags(from : String) -> [String:String]

By convention, we accept any text before the first tag as un-keyed text.

func generateTags(from : String) -> (text : String, fields : [String : String])

We use a restricted set of characters to convey tags, usually square and angle brackets.

  • $NAME=VALUE creates a field named NAME with a one-word value VALUE.
  • {NAME=VALUE} creates a field named NAME with the value VALUE. VALUE in this case may contain spaces or any character up to the closing bracket.
  • [NAME] creates a field named NAME with a value NAME.
Clone this wiki locally