From 16d12517398d6a0dd3393b5a1a28c47eb99e6340 Mon Sep 17 00:00:00 2001 From: Martin Geno Date: Sun, 21 Jan 2018 21:06:04 +0100 Subject: [PATCH] add documentation + rename database from yanic to respondd --- config_example.toml | 10 ++++++ database/all/main.go | 1 + database/{yanic => respondd}/main.go | 4 +-- database/{yanic => respondd}/main_test.go | 2 +- docs/docs_configuration.md | 38 ++++++++++++++++++++++- 5 files changed, 51 insertions(+), 4 deletions(-) rename database/{yanic => respondd}/main.go (96%) rename database/{yanic => respondd}/main_test.go (98%) diff --git a/config_example.toml b/config_example.toml index bcceb1c..993f9fc 100644 --- a/config_example.toml +++ b/config_example.toml @@ -163,6 +163,16 @@ address = "localhost:2003" # probably wont care much about "polluting" the namespace. prefix = "freifunk" +# respondd (yanic) +# forward collected respondd package to a address +# (e.g. to another respondd collector like a central yanic instance or hopglass) +[[database.connection.respondd]] +enable = false +# type of network to create a connection +type = "udp6" +# destination address to connect/send respondd package +address = "stats.bremen.freifunk.net:11001" + # Logging [[database.connection.logging]] enable = false diff --git a/database/all/main.go b/database/all/main.go index fae0160..c353c80 100644 --- a/database/all/main.go +++ b/database/all/main.go @@ -4,4 +4,5 @@ import ( _ "github.com/FreifunkBremen/yanic/database/graphite" _ "github.com/FreifunkBremen/yanic/database/influxdb" _ "github.com/FreifunkBremen/yanic/database/logging" + _ "github.com/FreifunkBremen/yanic/database/respondd" ) diff --git a/database/yanic/main.go b/database/respondd/main.go similarity index 96% rename from database/yanic/main.go rename to database/respondd/main.go index 5451b1c..998eec7 100644 --- a/database/yanic/main.go +++ b/database/respondd/main.go @@ -1,4 +1,4 @@ -package yanic +package respondd /** * This database type is for injecting into another yanic instance. @@ -33,7 +33,7 @@ func (c Config) Address() string { } func init() { - database.RegisterAdapter("yanic", Connect) + database.RegisterAdapter("respondd", Connect) } func Connect(configuration map[string]interface{}) (database.Connection, error) { diff --git a/database/yanic/main_test.go b/database/respondd/main_test.go similarity index 98% rename from database/yanic/main_test.go rename to database/respondd/main_test.go index c3ed048..db73a13 100644 --- a/database/yanic/main_test.go +++ b/database/respondd/main_test.go @@ -1,4 +1,4 @@ -package yanic +package respondd import ( "testing" diff --git a/docs/docs_configuration.md b/docs/docs_configuration.md index 27b77ad..5c67c16 100644 --- a/docs/docs_configuration.md +++ b/docs/docs_configuration.md @@ -579,13 +579,49 @@ prefix = "freifunk" +## [[database.connection.respondd]] +{% method %} +Forward collected respondd package to a address +(e.g. to another respondd collector like a central yanic instance or hopglass) +{% sample lang="toml" %} +```toml +enable = false +type = "udp6" +address = "stats.bremen.freifunk.net:11001" +``` +{% endmethod %} + + +### type +{% method %} +Type of network to create a connection. + +Known networks are "tcp", "tcp4" (IPv4-only), "tcp6" (IPv6-only), "udp", "udp4" (IPv4-only), "udp6" (IPv6-only), "ip", "ip4" (IPv4-only), "ip6" (IPv6-only), "unix", "unixgram" and "unixpacket". +{% sample lang="toml" %} +```toml +type = "udp6" +``` +{% endmethod %} + + +### address +{% method %} +Destination address to connect/send respondd package. +{% sample lang="toml" %} +```toml +address = "stats.bremen.freifunk.net:11001" +``` +{% endmethod %} + + + ## [[database.connection.logging]] {% method %} This database type is just for, debugging without a real database connection. A example for other developers for new database types. {% sample lang="toml" %} ```toml -enable = false +enable = false path = "/var/log/yanic.log" ``` {% endmethod %}