Macros

This module it’s optional extension to automatically generation of InfluxReader[T], InfluxWriter[T].

Quick start

Add to your build.sbt:

libraryDependencies += "com.github.fsanaulla" %% "chronicler-macros" % <version>

Annotate your case class:

final case class Test(@escape @tag name: String, @field age: Int, @timestamp time: Long)

Generate your writer/reader manually:

implicit val wr: InfluxWriter[Test] = Influx.writer[Test]
implicit val rd: InfluxReader[Test] = Influx.reader[Test]

or

import com.github.fsanaulla.chronicler.macros.auto._

Glossary of terms

Tag

All tag’s field must be marked with @tag.

Supported types:

Can be combined with additional @escape annotation for escaping special character.

Field

All field’s must be market with @field annotation. It can’t be optional.

Supported types:

Timestamp

It has different behavior for InfluxReader[_] and InfluxWriter[_].

For InfluxReader[_] there are four options:

Additional annotations will speed up your InfluxReader[_].

For InfluxWriter[_] there are two options:

Escape

Special character should be escaped. If you want to enable escaping on the field mark it with @escape annotation. Rules: